micropython/tests/basics/try1.py

12 lines
127 B
Python

# basic exceptions
x = 1
try:
x.a()
except:
print(x)
try:
raise IndexError
except IndexError:
print("caught")