I'm trying to make a number generator with a high number without using shell but it's not working

import random
num = None
random.randint(1, 1000000000000)
print (num)

Remember to assign the random number.

i’m new, what do you mean? also I don’t want to initialize the variable

Like this,

from random import randint

num = randint(1, 1000000) 

print (num)

Be sure to start the course at the very beginning so you cover the basics on variables and assignment.

a = 42

The above assigns, 42 to the variable, a. The number lives in a permanent spot in memory, and the variable now points to the address where it resides.

What’s neat about Python, is if more than one variable refers to the same number, they both point to the same place in memory.

1 Like