Python Program to Randomly Select an Element From the List (Using random module)

bookmark

import random

my_list = [1, 'a', 32, 'c', 'd', 31]
print(random.choice(my_list))

 

Output

31