Python Forum
How to properly catch this exception
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to properly catch this exception
#5
Thanks everyone. I finally did it. So happy.
score = 0
while True : 
    score = input('number btw 0 and 1\n')
    try :
    	score = float(score)
    	if score>=0 and score<=1:
    		break
    except :
    	print('not number')
    
Reply


Messages In This Thread
RE: How to properly catch this exception - by buran - May-26-2020, 10:42 AM
RE: How to properly catch this exception - by Emekadavid - May-26-2020, 02:02 PM
RE: How to properly catch this exception - by buran - May-27-2020, 08:00 AM

Forum Jump:

User Panel Messages

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