Случайное число Python
# generate random integer values
from random import randint
value = randint(0, 10)
print(value)
Successful Stoat
# generate random integer values
from random import randint
value = randint(0, 10)
print(value)
import random
# generates completely random number
x = random.random()
# generates a random int
x = random.randint()
# generates a random int in a range
x = random.randint(1, 100)
# NOTE: RANGE DOESN'T WORK FOR random.random()
import random
print("Generating 3 random integer number between 100 and 999 divisible by 5")
for num in range(3):
print(random.randrange(100, 999, 5), end=', ')