+ 1

try: print(1) print(10 / 0) except ZeroDivisionError: print(unknown_var) finally: print("This is executed last

Why is 1 printed?

1st Aug 2019, 4:42 AM
Dhyey Badheka
Dhyey Badheka - avatar
3 Antworten
+ 3
Maybe you include code, can you post it here.
1st Aug 2019, 5:40 PM
Bapi
Bapi - avatar
+ 2
Because it is before the exception is encountered.
1st Aug 2019, 4:51 AM
Sonic
Sonic - avatar