Which type of error is caused by forgetting to close parenthesis?
- Logic error
- Syntax error
- Type error
- Iterative error
What is an exception?
- An error that occurs when a program runs out of resources or time.
- An error that occurs when a program encounters an invalid input or operation.
- An error that occurs when a program fails to meet its specifications or requirements.
- An error that occurs when a program behaves unexpectedly or unpredictably.
What is the purpose of defensive design?
- To ensure that a program runs correctly and continues to run no matter what actions a user takes.
- To ensure that a program runs quickly and efficiently.
- To ensure that a program runs on any platform or device.
- To ensure that a program runs without any errors or bugs.
What is another name for final testing?
- Terminal testing
- Active testing
- Boolean testing
- Iterative testing
In Python, what is the purpose of a Try - Except block?
- To try all variations of input values
- To run code except for specified commands
- To prevent the program from crashing if an error occurs
- To allow division by zero
A user enters their age as "potato". What type of data has been entered?
- Normal data
- Boundary data
- Invalid data
- Erroneous data
When should comments not be added to code?
- To state the purpose of the program
- To identify the end of a
for loop - To describe the purpose of a function
- When code is obvious and self-explanatory
Which type of input validation should be used to check that an email address contains an @ symbol?
- Range check
- Length check
- Format check
- Presence check
Which programming practice contributes to improved code maintainability?
- Writing overly complex and lengthy functions
- Avoiding the use of comments in the code
- Following a consistent coding style and naming conventions
- Ignoring code documentation
Which type of test data should be accepted by the program?
- Normal data
- Any data type
- Invalid data
- Erroneous data