Code logic description | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Code logic description

Why this code results 1 & 3 ? what is the logic ? https://code.sololearn.com/cme9QcRfeLBK/#py

26th Jan 2018, 11:29 PM
NIMA
NIMA - avatar
1 Answer
+ 4
Since no exceptions were thrown, only the code in the try and finally blocks are executed. If an error did occur in the try block, the catch block would have executed immediately. The finally block is always executed last.
27th Jan 2018, 12:07 AM
David Carroll
David Carroll - avatar