0

I am trying the below program, but getting Attribute error . Can someone help me solve this issue?

import random

print(random.randrange(1, 10))
Attribute error: partially initialized module 'random' has no attribute 'randrange'(most likely due to a circular import) 
4

1 Answer 1

2

Please check if you have named your file or srcipt as random.py , that is causing confusion with the random module .

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.