Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help with python please Write a program that reads a sequence of integer inputs and uses a while loop and and if/else statement

I need help with python please

Write a program that reads a sequence of integer inputs and uses a while loop and and if/else statement to print the number of even and odd inputs.

image text in transcribed

Ex: If the inputs are 3,6,79,12,Q it would look like this for the input: Enter an integer (Q to quit): 3 Enter an integer (Q to quit): 6 Enter an integer (Q to quit): 7 Enter an integer (Q to quit): 9 Enter an integer (Q to quit): 12 Enter an integer (Q to quit): 8 and this for the output: The user entered 2 even values and 3 odd values. Ex: If the inputs are 4,11,24,5,9,2,Q, and entire run of the program would be: Enter an integer (Q to quit): 4 Enter an integer ( Q to quit): 11 Enter an integer ( Q to quit): 2 Enter an integer (Q to quit): 24 Enter an integer (Q to quit): 5 Enter an integer (Q to quit): 9 Enter an integer (Q to quit): 2 Enter an integer (Q to quit): Q The user entered 3 even values and 3 odd values

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeffrey A. Hoffer Fred R. McFadden

4th Edition

0805360476, 978-0805360479

More Books

Students also viewed these Databases questions

Question

Decision Making in Groups Leadership in Meetings

Answered: 1 week ago