Specifying exception type : Exception Type « Exception « Python






Specifying exception type


# 
try:
    num = float(raw_input("\nEnter a number: "))
except(ValueError):
    print "That was not a number!"
           
       








Related examples in the same category