Random Module AttributeError , 'random' has no attribute 'randint'
Question:
Answers:
Rename your file from random.py
to something else. Python is getting confused because the file name shadows the random
module.
BTW, this is what the circular import warning is about. You are importing random
, which is the file name. So, it imports the file you wrote. Whenever it imports the file, import random
is executed, which imports the file you wrote…
Rename your file from random.py
to something else. Python is getting confused because the file name shadows the random
module.
BTW, this is what the circular import warning is about. You are importing random
, which is the file name. So, it imports the file you wrote. Whenever it imports the file, import random
is executed, which imports the file you wrote…