In a try - except block, where should the code that may raise an exception be placed?
- In the
except block - Outside both
try and except blocks - In the
finally block - Inside the
try block
Which type of error does not crash the program, but produces unexpected results?
- Logic error
- Syntax error
- Type error
- Iterative error
A system stores a user's age (e.g. 14). Which data type should be used?
- Float
- Integer
- String
- Boolean
What is authentication?
- Verifying the role of a user using permissions, roles, or groups.
- Verifying the location of a user using GPS, IP address, or cookies.
- Verifying the time of a user using clocks, timers, or timestamps.
- Verifying the identity of a user using passwords, tokens, or biometrics.
Which type of input validation checks if the entered data is a valid date, email address, or phone number?
- Range validation
- Format validation
- Length validation
- Presence validation
Which type of input validation should be used to check a National Insurance number?
- Range check
- Length check
- Format check
- Presence check
Which type of error is caused by misspelling a variable name?
- Logic error
- Syntax error
- Type error
- Iterative error
Which type of test data is outside the limits of valid data
- Normal data
- Boundary data
- Invalid data
- Erroneous data
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
When user input fails a validation check, what should be included in the failure message?
- Detailed technical information
- Error codes relating to source code line numbers
- Simple instructions to help the user re-try
- Nothing