1.7. Syntax errors
Python can only execute a program if what?
If the program is syntactically correct
What should we know about how Python acts with syntax errors?
It is NOT forgiving. If there is a single syntax error anywhere in your program, Python will display an error message and quit. You will not be able to complete the execution of your program.
What happens in Python if the program is not syntactically correct?
The process fails and returns an error message
What does Syntax refer to?
The structure of a program and the rules about that structure. For example, in English, a sentence must begin with a capital letter and end with a period. this sentence contains a syntax error. So does this one.
Which of the following is a syntax error? a) attempting to divide by 0 b) forgetting a colon at the end of a statement where one is required c) forgetting to divide by 100 when printing a percentage amount
b) forgetting a colon at the end of a statement where one is required
Who or what typically finds syntax errors? a) the programmer b) the compiler/interpreter c) the computer d) the teacher/instructor
b) the compiler/interpreter The compiler and/or interpreter is a computer program that determines if your program is written in a way that can be translated into machine language for execution