lundi 11 février 2019

Sort an array of string using "random.shuffle" list indice not nonetype error

I'M HAVING PROBLEMS WITH RANDOM IN THIS PROBLEM, THE CONSOLE RETURNS ERROR IN LINE: 201 THE ERROR IS: TypeError: list indices must be integers or slices, not NoneType

import random
array_Ordem = []
i = int(1)
while i <= 4:
    array_Ordem.append(input('Digite o nome do aluno da apresentação: '))
    i = i + 1
print('A ordem da apresentação será: {}'.format(array_Ordem[random.shuffle(array_Ordem)]))




Aucun commentaire:

Enregistrer un commentaire