Blank except Clauses : Try : Statement PYTHON TUTORIALS


PYTHON TUTORIALS » Statement » Try »

 

Blank except Clauses


while True :
    try:
       v = intraw_input("Enter a value: "))
       print "We got some valid input!"
       x = 100 / v
       break
    except (KeyboardInterrupt):
       print "well, ok, if you don't really want to.."
       break
    except ZeroDivisionError:
       print "You can't divide by ZERO!"
    except:
       print "Some other error happened here"



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Statement
» Try