What is the use of exception handling finally keyword in python?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 1

What is the use of exception handling finally keyword in python??

And what is the use of rise functions in python??

21st Oct 2017, 5:00 PM
VIJAY MADDINENI
VIJAY MADDINENI - avatar
2 Answers
0
It means Try this Except this and FINALLY do this. Well it might not seem to be of any use, but it make more sense to the programmer to have a finally rather than just writing code in next line as usual. It is exactly like If and elif We could have used if if if if lots of if......but elif makes more sense
21st Oct 2017, 5:07 PM
Niush
Niush - avatar
- 1
In the first page of "finally task" they say that "Code within a finally statement always runs after execution of the code in the try" My question is why does an error occurs when I print something whith a error thype whith in print, like: finally: print("1"//"frank")
17th Nov 2017, 3:03 PM
Filipe Gomes