H Study Guide - Quiz Guide: Array Data Structure, Exception Handling

8 views3 pages

Document Summary

Error in python can be of two types i. e. syntax errors and exceptions. Errors are the problems in a program due to which the program will stop the execution. On the other hand, exceptions are raised when some internal events occur which changes the normal flow of the program. Syntax error: as the name suggests this error is caused by the wrong syntax in the code. It leads to the termination of the program. # initialize the amount variable amount = 10000. # purchase dsa self paced or not if(amount>2999) print("you are eligible to purchase dsa self paced") Exceptions: exceptions are raised when the program is syntactically correct, but the code resulted in an error. This error does not stop the execution of the program, however, it changes the normal flow of the program. # initialize the amount variable marks = 10000. # perform division with 0 a = marks / 0 print(a)

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers

Related Documents