Random number | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Random number

Does anyone know the Python codes for a random number

11th May 2017, 7:06 PM
Nicolas Forkel
3 Answers
+ 6
import from the random module. Depending on what you need, use random, randrange, randint or what fits your needs. further reading: https://docs.python.org/3/library/random.html
11th May 2017, 7:23 PM
Tob
Tob - avatar
+ 1
thx
11th May 2017, 7:24 PM
Nicolas Forkel
0
Import random A =(random.randint(1, 5)) print(A)
11th May 2017, 7:27 PM
DRAGONGAMING
DRAGONGAMING  - avatar