I am new to Python and I am trying to make a program that lets the user input positive numbers. The program should then return a list of the numbers aswell as the number of even numbers in the list. I have written this piece of code.
numbers = [] # An empty list print('Input positive whole numbers. Stop with zero.') x = int(input('First number: ')) n = 0 i = 0 while x > 0: numbers.append(x) x = int(input('Next: ')) print('List:', numbers) while i < len(numbers): if numbers[i]%2 == 0: n += 1 i += 1 print('Number of even numbers: ', n)But it only returns the list and not the number of even numbers. Why?