Python Programming only (my code below) create a method to find the average Your method must perform the following The method must take in at least one value as a parameter. The method must return a value You must use Exception handling in your method (My code below) numList = [] while(True): variable = input("Enter a number or Enter done to quit: ") if(variable=='done'): break numList.append(int(variable)) # display the information print("The total amount of numbers entered : ",len(numList)) print("The total of numbers : ",sum(numList)) print("The average of all numbers : ",sum(numList)/len(numList)) print("The largest number is: ",max(numList))
Python Programming only (my code below) create a method to find the average Your method must perform the following The method must take in at least one value as a parameter. The method must return a value You must use Exception handling in your method (My code below) numList = [] while(True): variable = input("Enter a number or Enter done to quit: ") if(variable=='done'): break numList.append(int(variable)) # display the information print("The total amount of numbers entered : ",len(numList)) print("The total of numbers : ",sum(numList)) print("The average of all numbers : ",sum(numList)/len(numList)) print("The largest number is: ",max(numList))
Chapter11: Exception Handling
Section: Chapter Questions
Problem 2CP
Related questions
Question
Python
- create a method to find the average
Your method must perform the following
- The method must take in at least one value as a parameter.
- The method must return a value
- You must use Exception handling in your method
(My code below)
numList = []
while(True):
variable = input("Enter a number or Enter done to quit: ")
if(variable=='done'):
break
numList.append(int(variable))
# display the information
print("The total amount of numbers entered : ",len(numList))
print("The total of numbers : ",sum(numList))
print("The average of all numbers : ",sum(numList)/len(numList))
print("The largest number is: ",max(numList))
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 3 steps with 2 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,