lista_da_tupla_a=(["0", "33", "40"], ["8", "30","9"], ["7", "0", "0"])
lista_da_tupla_a = list
lista_da_tupla_a[2] = "5"
print(lista_da_tupla_a)
Desired output: (["0", "33","5"], ["8","30",5], ["7","0","5"])
lista_da_tupla_a=(["0", "33", "40"], ["8", "30","9"], ["7", "0", "0"])
lista_da_tupla_a = list
lista_da_tupla_a[2] = "5"
print(lista_da_tupla_a)
Desired output: (["0", "33","5"], ["8","30",5], ["7","0","5"])
I think what you want is this:
lista_da_tupla_a = (["0", "33", "40"], ["8", "30","9"], ["7", "0", "0"])
for tuplinha in lista_da_tupla_a:
tuplinha[2] = "5"
print(lista_da_tupla_a)
That is, you use for
to go through each trio and replace the third element with "5"
.
Here's the output:
(['0', '33', '5'], ['8', '30', '5'], ['7', '0', '5'])