Python Exercise: Count the number of even and odd numbers from a series of numbers
Write a Python program to count the number of even and odd numbers in a series of numbers
Pictorial Presentation of Even Numbers:
Pictorial Presentation of Odd Numbers:
Sample Solution:
Python Code:
Sample Output:
Number of even numbers : 4 Number of odd numbers : 5
Flowchart:
Even Numbers between 1 to 100:
Odd Numbers between 1 to 100:
Python Code Editor:
Have another way to solve this solution? Contribute your code (and comments) through Disqus.
Previous: Write a Python program that accepts a word from the user and reverse it.
Next: Write a Python program that prints each item and its corresponding type from the following list.
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics