I need help with python | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

I need help with python

Hey so I am needing help with a number generator what would be the import for it because It needs to pick a number 1 through 999,999,999,999,999 🙂

30th Nov 2020, 8:09 PM
Track
Track - avatar
3 Answers
+ 7
import random z = random.randint(1,999) print(z)
30th Nov 2020, 9:27 PM
🔥EACY🔥
🔥EACY🔥 - avatar
+ 2
You can use randint function from random module. Integers in Python have no size limit so you can use the big number directly in the function.
30th Nov 2020, 8:57 PM
Seb TheS
Seb TheS - avatar
+ 1
random or secrets module.
30th Nov 2020, 8:52 PM
rodwynnejones
rodwynnejones - avatar