##### How do you generate random numbers in Python?

i just want to know...............................

christiant (1)

The easiest method to do this is:

```
import random
random.randint(1, 10)
```

This simply chooses a random number between 1 and 10. You can change the two numbers to whatever you want just remember that the first number is the `minimum`

and the second number is the `maximum`

.

I hope this helped.

SagaciousPan (22)

@BOIBOI1

The below code will print a random number between 1 and 100 ten times.

```
# import the 'random' library and it's commands
import random
# do this 10 times
for x in range(10):
#print a random number between 1 and 100
print (random.randint(1,101))
```

Test at:

https://repl.it/@SagaciousPan/Random-Number-Python

Hope I could help!

Please mark this as answered if your problem has been solved.

SixBeeps (5052)

https://docs.python.org/3/library/random.html

TL;DR, you can import the `random`

library, and from there, call `random.randrange(start, stop, step)`

to get a random number

These two ways are my favourite:

from random import *

randint (1, 10)

and

import random

random.randint (1, 10)