NameError: name 'random' is not defined
You have to import the module random
:
import random
r = random.randint(1,10)
# ...
>>> import random
>>> r = random.randint(1,10)
>>> r
10
You have to import the module random
:
import random
r = random.randint(1,10)
# ...
>>> import random
>>> r = random.randint(1,10)
>>> r
10