Question: Problem 2 : Count Odd and Even Using Loops Points Possible: 2 0 This problem will provide you with an opportunity to demonstrate your understanding
Problem : Count Odd and Even Using Loops
Points Possible:
This problem will provide you with an opportunity to demonstrate your understanding of loops, lists, and string methods.
Instructions:
Write a program that allows the user to input as many integers as they would like, separated by commas. The program then counts the number of even numbers using a while loop. To verify that this count is correct, the program also counts the number of odd numbers using a for loop. You will need to perform the following steps.
Ask the user to enter integers separated by commas.
Convert the input to a list of integers.
Print the total count of numbers entered.
Use a while loop to go through the list and count the even numbers.
Use a for loop to go through the list and count the odd numbers.
Print the counts to the shell.
When your program runs, it should match the expected output below but should work for any user input that consists of integers separated by commas.
Submission: Save your programs source code using the following naming convention:
PSPpy
Submit the file as per the instructions under the 'Submission' section in the General Instructions for Problem Sets document. You will submit this file and all other problem set solution files at the same time.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
