-1
I know that for the present code it is necessary to use a repeating structure, and it can be while one of these. But I couldn’t link such a command to my code.
In order to facilitate understanding, I leave the question here:
A program that asks the user for multiple numbers and displays whether he is even or odd. The program stops asking for a number when the user type 0.
Code did:
print() #Espaço1
print('Digite apenas números ')
print() #E2
numpar = 0
numimpar = 0
while True:
numero = int(input('Digite o número: '))
for i in while():
if numero % 2 == 0:
numpar += 1
else:
numimpar += 1
print(f'Pares {numpar}')
print(f'Impares {numimpar}')
I used the following:
– Daniel Alves de Barros
Hello! Dear colleague, @Paulomarques, thank you for the touch.
– Daniel Alves de Barros