Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a Python function to sum all the numbers in a list. Prompt the user for a number(s) they wish to add: o User
Write a Python function to sum all the numbers in a list. Prompt the user for a number(s) they wish to add: o User will enter the letter Q if / when there are no (more) numbers they wish to enter o Do not use sum to add the numbers entered by the user Sample: 8, 2, 3, 0, 7 Expected Output: 20 Write a Python function that accepts a string and calculates the number of uppercase letters and lowercase letters. Prompt the user for a string o Check if the string is empty Output: . You entered an empty string. Number of uppercase characters: 0 Number of lowercase characters: 0 Sample String: Ontario is in Canada o Expected Output: Number of uppercase characters: 2 Number of lowercase characters: 15 Write a Python recursive function to calculate the factorial of a number (a non-negative integer). o Prompt users for more numbers if they want to find the factorials for. o User should enter the letter Q to if / when there are no (more) numbers they wish to find factorial for. The function accepts the number as an argument. Factorial formula: n! = nx (n-1) x... x 1 o Example: 4! = 4 x (4-1) x (3-1) x (2-1) o Output: Factorial 4! = 24
Step by Step Solution
★★★★★
3.51 Rating (161 Votes )
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