1
I’m doing a futsal game with POO, and I went to do a function outside the class and in the global scope assigns the vector lista_team = []
, only when I’m trying to run the stage where the code is, it generates an error, what can it be? I want to add the answer to input
to the vector, at each position.
lista_team.append() = input('Digite o nome do seu time: \n')
File "C:\Python37\Scripts\futsal.py", line 45 lista_team.append() = input('Digite o nome do seu time: \n') ^ SyntaxError: can't assign to function call
Just pass on the result of
input
as a parameter ofappend
:lista_team.append(input('Digite o nome do seu time: \n'))
– hkotsubo