-3
Hello, I am doubtful in a matter of a list of Algorithms, it asks to create an algorithm where the user informs a certain amount of numbers and for when he type 0. At the end of the program he wants the algorithm to separate even numbers from odd.
My problem itself is that my program is not reporting the first number dialed by the user and I do not know how to solve.Below I put a photo to make it easy to view the problem. I also accept tips and criticism, I’m new in programming.
x = int(input("Digite valores"))
lista = []
lista2 = []
lista3 = []
while x != 0:
x = int(input("Digite valores"))
lista.append(x)
for i in range(len(lista)):
if i%2 != 0:
lista2.append(lista[i])
print("Os valores ímpares são",lista2)
for s in range(len(lista)):
if s%2 == 0:
lista3.append(lista[s])
print("Os valores pares são",lista3)
Edit your question to remove code as image. As you can read in this post, image format codes is not a good idea.
– Luiz Felipe
The photo does not facilitate visualization, but rather makes it difficult and prevents anyone who wants to test their code to copy and paste it into the debugger.
– Augusto Vasques