from random import randrange foo = ['a', 'b', 'c', 'd', 'e'] indice_aleatorio = randrange(len(foo)) print(indice_aleatorio)