RosettaCodeData/Task/Arrays/Python/arrays-7.py
Ingy döt Net 80737d5a6a new tasks
2013-04-09 00:46:50 -07:00

6 lines
159 B
Python

try:
# This will cause an exception, which will then be caught.
print array[len(array)]
except IndexError as e:
# Print the exception.
print e