gerar lista de um input

Anonymous
python
11/21/2022 2:00 AM
316 B
20
Indexable
#METODO 1 GERAR LISTA COM VIRGULA
op = input('DIGITE AS OPÇÕES: ').split(',')
print(op)
#METODO 2 GERAR LISTA COM LAÇO FOR OU WHILE:
lista = []
for i in range(3):
    op = input('DIGITE AS OPÇÃO: ')
    lista.append(op)
print(lista)
Editor is loading...