RosettaCodeData/Task/Flow-control-structures/Python/flow-control-structures-5.py

7 lines
198 B
Python
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
try:
temp = 0/0
# here, 'except' catches a specific type of error raised within the try block.
except ZeroDivisionError:
print "You've divided by zero!"
# Output : "You've divided by zero!"