python random random code example
Example 1: random number python
from random import randint
value = randint(0, 10)
print(value)
Example 2: python random
import random
print(random.randint(1, 100))
Example 3: python random
import random
names = ['Harry', 'John', 'Smith', 'Larry']
print(random.choice(names))
print(random.randint(1, 100)
Example 4: random number python
import random
num = random.randint(1, 10)
print(num)
Example 5: python random number
import random
start = 1
end = 8
number = random.randint(start, end)
print(number)