Question: Modify the program, so that utilizes exception handling to prevent at least two conceivable runtime errors. Explain with these errors are and how the program
Modify the program, so that utilizes exception handling to prevent at least two conceivable runtime errors. Explain with these errors are and how the program will respond.

def main(): print("This code will average a series of numbers entered by the user") num = eval(input ("How many numbers do you want to average? ")) X = 0 S = 0 while x < num: try: D A s += int(input('Enter a number: ')) main() except ValueError: print ("Invalid input.") else: X += 1 I print("The total value of your", num, "numbers is ", s) print("The average of your", num, "numbers is ", s/num)
Step by Step Solution
There are 3 Steps involved in it
To improve the program and handle potential runtime errors particularly those ... View full answer
Get step-by-step solutions from verified subject matter experts
