Question: I formulated the code block for a while loop program below, but I have been asked to use try / except instead. Could someone please
I formulated the code block for a while loop program below, but I have been asked to use try except instead. Could someone please help with this?
n # variable to store user inputting integers
mylist # variable to store the sum of integers
count # variable to count the total number of integers input
# loop till ns input value is not
while n :
# input for the value of an integer
n intinputEnter a number to quit:
# If n is not add n to mylist and increase the count by
if n :
mylist mylist n
count count
# print mylistcount which provides the average of all counted integers
printThe average of numbers is mylistcount
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
