Question OOP-EXC-0038
EasyWhat is the output of this code?
try:
[1, 2][5]
except IndexError:
print("index")
except Exception:
print("other")
- A.
Error
- B.
index other
- C.
Sign up free to see the answer and a step-by-step explanation.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Exception Handling question
What is the output of this code?
try:
[1, 2][5]
except IndexError:
print("index")
except Exception:
print("other")
Error
index other
Sign up free to see the answer and a step-by-step explanation.
other
index