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

bookmark

import secrets

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

 

Output

c