Specifying exception type : Exception Type « Exception « Python
- Python
- Exception
- Exception Type
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