Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PYTHON Write a program to enter a valid variable till the user wants to end. The program should display the count of positive, negative, zeros

PYTHON

Write a program to enter a valid variable till the user wants to end. The program should display the count of positive, negative, zeros and letters (upper and lower case)/symbols (error handling) entered.

Based on the problem, you need to design an algorithm as follows:

1. Get the user input until n is entered

2. Add to the positive if it is greater than zero

3. Add to the negative if it is less than zero

4. Add to the zero if it is neither less than or greater than zero

5. Add to the letters/symbols if it none of the above

6. Output the totals as seen in sample output

Note: You need to prompt the user for input and continue to do so until n is selected and produce the specified output! (See below)

Hint: Use a Loop

Sample Output

User input: Enter input : 56

Do you want to Continue(y/n)? y

Enter input : -9

Output:

Positive Number(s) : 3

Negative Number(s) : 4

Zero(s) : 2 Letter(s) : 1

Symbol(s): 1

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

The Accidental Data Scientist

Authors: Amy Affelt

1st Edition

1573877077, 9781573877077

More Books

Students also viewed these Databases questions

Question

2. What, according to Sergey, was strange at this meeting?

Answered: 1 week ago

Question

3. Are our bosses always right? If not, what should we do?

Answered: 1 week ago