Question
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started