Python can generate random numbers and choose random items from list/strings.
It is not really random but something so close to random (pseudo-random) that you can treat it as random.
import random
In order to use the built-in random functions you must have the following line at the start of your program.
from random import randint
If you only want to use one particular function from the random module you can also use.
Use random floating point numbers
import random
num = random.random()
num = num * 100
print(num)
Use random integer numbers
import random
num = random.randint(0, 9)
print(num)
Use random numbers with steps (e.g. multiples of five)
import random
num = random.randrange(0, 100, 5)
print(num)
Use random item from a list
import random
names = [
'Albert',
'Bradley',
'Charles',
'David',
'Edward',
]
name = random.choice(names)
print(name)
Use random letter from a string
import random
alphabet = 'abcdefghijklmnopqrstuvwxyz'
letter = random.choice(alphabet)
print(letter)