Python Programming - Conditional Statements - Discussion

Discussion Forum : Conditional Statements - General Questions (Q.No. 11)
11.
Which of the following statements is used for handling exceptions?
try-case
for-in
while-break
try-except
Answer: Option
Explanation:
The try-except statement is used for exception handling in Python. Code within the try block is executed, and if an exception occurs, it can be caught and handled in the except block.
try:
    # code that might raise an exception
except SomeException:
    # code to handle the exception
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.