-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtry_except.py
More file actions
42 lines (37 loc) · 790 Bytes
/
try_except.py
File metadata and controls
42 lines (37 loc) · 790 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
try:
print(a)
except NameError as erro:
print('Developer error, talk to him.')
try:
a = []
print(a[1])
except IndexError as erro:
print('Index error.')
try:
print(a)
except Exception as erro:
print('Unexpected error')
try:
print(a)
a = []
print(a[1])
except NameError as erro:
print('Developer error, talk to him.')
except IndexError as erro:
print('Index error.')
except Exception as erro:
print('Unexpected error')
try:
print(a)
a = []
except NameError as erro:
print('Developer error, talk to him.')
except IndexError as erro:
print('Index error.')
except Exception as erro:
print('Unexpected error')
else:
print('Code successfully executed')
finally:
print('Always runs at the end')
print('continue')