Part 9 Flashcards

1
Q

What is the syntax of a language?

A

The permitted structure of words/sentences in a language, or programs in a programming language.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

In what procedure does a compiler or interpreter check the syntax of a program?

A

Parsing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are some common syntax errors in Python?

A

Missing commas

Missing colons

Incorrect indentation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

When does the python syntax checker run, and how much of the program does it analyse at a time?

A

Before the program is run, it checks the entire program for syntax

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a type error and when will it be detected?

A

Using wrong type, e.g. string where should be an int

Detected at runtime

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a runtime error?

A

An error that occurs when the program runs, rather than when it is compiled.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are some examples of runtime errors in python?

A

Divison by 0

Type errors

Invalid identifiers

Invalid subscripting

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a logic error?

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How can logic errors be detected?

A

Thorough testing of the program

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly