Which statements are used for error handling in Python?

IT Questions BankCategory: CCNPWhich statements are used for error handling in Python?
Which statements are used for error handling in Python? 1ITExamAnswers Staff asked 1 month ago
Question:
Which statements are used for error handling in Python?

  • A. try/catch
  • B. catch/release
  • C. block/rescue
  • D. try/except

Explanation: The words “try” and “except” are Python keywords and are used to catch exceptions. For example:
try:
print 1/0
except ZeroDivisionError:
print ‘Error! We cannot divide by zero!!!’

More Questions: CCNP 350-401 Dumps


Related Articles