1.7. Syntax errors

Ace your homework & exams now with Quizwiz!

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


Related study sets

BA 530 - Financial Management (Charles Hodges) - Chapter 4 Quiz

View Set

Taylor's Chapter 39: Fluid, Electrolyte, and Acid-Base balance (PrepU)

View Set

Physical Science EOC review 2016

View Set

The Five People You Meet in Heaven Vocabulary

View Set

Ch11: Current Liabilities and Payroll Accounting

View Set