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.......
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)
You can use randint method.
Eg., import random #import random module
variable = random.randint(give the range here)
print(variable)
Hope this works