Is there any way to generate random numbers in python?
If there is a way ,what is it?
How many are there to generate?
Thanks in advance.......
You can use randint method.
Eg., import random #import random module
variable = random.randint(give the range here)
Hope this works
This is what Jaanvi is saying:
import random # set a range --- # I've set a range between 0 and 100 # since last value is exclusive rand_value = random.randint(0, 101) print(rand_value)
You can find more about random here: python docs - random (https://docs.python.org/3/library/random.html)