What is the primary purpose of the try - except
block in Python?
- To define a function
- To handle exceptions
- To create a loop structure
- To declare variables
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 system asks a user to enter a number between 1 and 100. Which of the following entries is erroneous?
What is meant by code maintainability?
- The speed at which code is executed
- The ease with which code can be understood, modified, and extended
- The size of the source code files
- The security measures implemented in the code
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.
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
What term describes the process of checking input data to ensure it falls within acceptable ranges or formats?
- Output verification
- Input validation
- Data encryption
- Program compilation
Which type of test data is of the wrong data type?
- Normal data
- Boundary data
- Invalid data
- Erroneous data
Which type of input validation should be used to check a National Insurance number?
- Range check
- Length check
- Format check
- Presence check