Part 9 Flashcards
What is the syntax of a language?
The permitted structure of words/sentences in a language, or programs in a programming language.
In what procedure does a compiler or interpreter check the syntax of a program?
Parsing
What are some common syntax errors in Python?
Missing commas
Missing colons
Incorrect indentation
When does the python syntax checker run, and how much of the program does it analyse at a time?
Before the program is run, it checks the entire program for syntax
What is a type error and when will it be detected?
Using wrong type, e.g. string where should be an int
Detected at runtime
What is a runtime error?
An error that occurs when the program runs, rather than when it is compiled.
What are some examples of runtime errors in python?
Divison by 0
Type errors
Invalid identifiers
Invalid subscripting
What is a logic error?
Incorrect logic in the code of a program. Things may appear to work normally but the programmer may have introduced an error with bad logic.
How can logic errors be detected?
Thorough testing of the program