Question: What is exception? What is difference between Syntax Error and Exceptions? Give an example of division by zero exception using try catch statement. See the
What is exception? What is difference between Syntax Error and Exceptions?
Give an example of division by zero exception using try catch statement. See the
codes block i and ii and compare the output :
i try:
a
print a
except LookupError:
print Index out of bound error."
else:
print Success
ii
a
try: print Second element da
print Fourth element da
except:
print An error occurred"
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
