Nov-15-2018, 10:53 PM
Hi im recently new to python and was coding for my homework and when I tried to run my program it gives me n error on the except statement. im currently using version 3.7.1
Here's the code (Python)
Here's the code (Python)
count = 0 total = 0 mean = 0 while True: command = input('Enter a number: ') if command == 'done': break try: count = count + 1 total = total + float(command) mean = float (total/float (count) except: count = count - 1 print ('invalid input, please enter a valid number') print ('You have entered : ',count,'numbers') print ('the total of your numbrs is : ', total) print ('The mean of your numbers is : ',mean)