0

What is wrong in my Code? It is run perfectly on pc

quantidade = int(input('How many peoples will be invited to the party? ')) x = 1 lista = [] while x <= quantidade: nomes = input('Enter the guest names, one at a time [',str(x),']: ') lista.append(nomes) x += 1 print (quantidade, 'peoples will be invited to the party') print ('\n GUEST LIST') for nomes in lista: print (nomes)

20th Nov 2017, 8:45 PM
Daniel Rodrigo
Daniel Rodrigo - avatar
2 Antworten
+ 1
Learn how to embed code via codeplayground. And read this question. https://www.sololearn.com/discuss/848425/?ref=app
20th Nov 2017, 8:57 PM
Porf
Porf - avatar
0
line 5: when you called input, the thing you're trying to do there with the square brackets and what not caused the function INPUT() to have 5 arguments. I removed that bit, here's the new code: quantidade = int(input('How many peoples will be invited to the party? ')) x = 1 lista = [] while x <= quantidade: nomes = input('Enter the guest names, one at a time') lista.append(nomes) x += 1 print (quantidade, 'peoples will be invited to the party') print ('\nGUEST LIST') for nomes in lista: print (nomes)
20th Nov 2017, 8:58 PM
Sapphire