-3
Guys I just started in python, I wonder what’s wrong with that code. I wanted to pass the numbers of valores
for valoresI
always skipping a position, so the x += 2
. But he keeps making mistakes.
If I put valoresI[4] = valores[4]
he even goes, but I needed to use a variable that changed this value of 2 in 2
while x <= 10:
valoresI[x] = valores[x]
x += 2
What error? From what I see can be this "x" there, in which case the result of your list valoresl will be half of the list correct values? Then Voce can make x = 0, and then run a while loop that will iterate your list/2 and each iteration x will be added by 2
– Elias Oliveira
as you initialized
x
,valoresI
andvalores
?– Paulo Marques
values = [] valueI = [] x = 0
– lucas gabriel