Explain try, raise, and finally?



Explain try, raise, and finally?..

Answer / Mahaveer Singh

In Python, the `try` keyword is used for error handling, as mentioned earlier. The `raise` keyword is used to deliberately trigger an exception. The `finally` block contains cleanup code that will always be executed, regardless of whether an error occurred in the `try` block or not.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Python Interview Questions

How do you get a list of all the keys in a dictionary in python?

1 Answers  


What is flask python used for?

1 Answers  


Which all are the operating system that Python can run on?

1 Answers  


What applications are written in python?

1 Answers  


Does python support multiple inheritance?

1 Answers  


What are advantages of a tuple over a list?

1 Answers  


Explain how to make Forms in python.

1 Answers  


How do you debug a program in python? Is it possible to step through python code?

1 Answers  


Why does it say none in python?

1 Answers  


Should I learn python or scala?

1 Answers  


Explain me inheritance in python with an example?

1 Answers  


Do you know what is numpy and how is it better than a list in python?

1 Answers  


Categories