Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Should be like this example: Please, show how to write a program in Python that asks user continuously for positive integer numbers. If typed a

Should be like this example:

image text in transcribed

Please, show how to write a program in Python that asks user continuously for positive integer numbers. If typed a zero, then stop asking and finish.

Calculate two totals (one for even and other for odd numbers) and print them out.

Find, how to decide, is the number even or odd.

Use the chart below:

image text in transcribed

Type a positive integer: 1 Type a positive integer: 3 Type a positive integer: 2 Type a positive integer: 4 Type a positive integer: 6 Type a positive integer: 0 Total of even numbers is: 12, total of odd numbers is 4 s_odd=0 S_even=0 ask for a number number is 0 -number is not 0 number is even -number is odd print S_odd and s_even _even=s_even+number s_odd=s_odd+number

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

Step: 3

blur-text-image

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

Intelligent Databases Technologies And Applications

Authors: Zongmin Ma

1st Edition

1599041219, 978-1599041216

More Books

Students also viewed these Databases questions

Question

4. Who should be invited to attend?

Answered: 1 week ago

Question

7. How will you encourage her to report back on the findings?

Answered: 1 week ago

Question

Were the decisions based on appropriate facts?

Answered: 1 week ago