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?
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:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers