Question: for this while, try and except code I need to not only get the average but also the number of times the floating point value

for this while, try and except code I need to not only get the average but also the number of times the floating point value was entered via len, the sum, sort the list of numbers and find the minimum and maximum. I was able to do this in a for loop but can't seem to include this in a while, try, and except without error. Basically, how do I merge the concepts from the for loop below into the while, try, and except code. I'm getting an error: TypeError: object of type 'float' has no len() just when I attempt to get the len.

Here is the for loop that I can't use b/c I need an while, try and exception :

for this while, try and except code I need to not only

_____________________________________________________________________________________________________________________________________

Here is the beginning of the while, try, and except which I need the length, sum, min and max concepts merged into:

total = 0.0 count = 0 value= 0.0

while value is not None:

try: value = float(input('Enter a floating point value :')) total += value count += 1 except: avg = total / count print('Average is ' + str(avg)) value =None

1 int (input ("Please enter the amount of numbers to input for n finding their average 3 numbers for i in range (0,n): num int(input ("Enter a floating point value numbers .append (num) avg sum (numbers) 10 print ("you entered values". format (len (numbers))) 11 print "Total of the entered numbers sum (numbers)) 12 print ("Average of the entered numbers round (avg,2)) 13 numbers. sort 14 print "The numbers you entered in sorted order: numbers) 15 print ("The minimum number you entered min (numbers 16 print ("The maximum number you entered max numbers 17

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!