Skip to main content

Foundations of Python Programming: Functions First

Section 3.2 Three kinds of Errors

Three kinds of errors can occur in a program: syntax errors
 1 
http://en.wikipedia.org/wiki/Syntax_error
, runtime errors
 2 
http://en.wikipedia.org/wiki/Runtime_error
, and semantic errors
 3 
http://en.wikipedia.org/wiki/Logic_error
. Syntax errors are mistakes that violate the rules of the Python programming language. Runtime errors occur when your code is valid, but tries to do something that is impossible at the time the code is run (like divide by zero, or multiply two string variables together). Semantic errors occur when the program runs successfully but doesn’t produce the correct output, because the program that was written does not correctly solve the problem as intended. The following sections will describe these three types of errors in more detail.
You have attempted of activities on this page.