Write a Python program to count the number of even and odd numbers from a series of numbers.


Topic: Write a Python program to count the number of even and odd numbers from a series of numbers.

Solution

numbers = (1, 2, 3, 4, 5, 6, 7, 8, 9) # Declaring the tuple
count_odd = 0
count_even = 0
for x in numbers:
        if not x % 2:
    	     count_even+=1
        else:
    	     count_odd+=1
             



List all Python Programs