import random rand_index = random.randrange(len(list)) random_num = list[rand_index] random_num = random.choice(list)