Python Forum
Is there a specialist in error handling ?
Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Is there a specialist in error handling ?
#7
my question here:Hi all. I should be very glad if you help me using error handling
# file2.py
size = 40
print("here is the addition of many numbers (even with a .) Maximum of numbers=", size)
print("Once you have finished your list of numbers, just press $ to indicate the end\n")
total = 0.0
value = 0.0
count = 1
while (count != 0):
   value = float(input("enter the value: "))
   if value == '$':
       average = total / count
       print("average value= ", average)
       exit()
   else:
       print(value)
       print(total)
       total = value + total
       print(total)
       count = count + 1


User has been warned for this post. Reason: 5
Reply


Messages In This Thread
Last endeavor for error handling - by sylas - May-22-2017, 05:14 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Class and Object HW for cars - Help with error handling for user inputs jakeshugart 2 376 May-09-2024, 05:00 PM
Last Post: jakeshugart
  Handling IO Error / Reading from file Expel 10 5,042 Jul-18-2019, 01:21 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020