I have the following list:
pessoa=("Filipe", 40, True)
I write the print command for each element:
print(pessoa[0])
print(pessoa[1])
print(pessoa[2])
The answers are:
Filipe
40
True
When I try to modify the first element:
pessoa[0]="Marconi"
recebo a resposta de erro abaixo:
Traceback (most recent call last):
File "D:/Licença/Scripts/A5825_Listas.py", line 16, in <module>
pessoa[0]="Marconi"
TypeError: 'tuple' object does not support item assignment
How do I modify an element of a list in Python?