Complete the sentence to explain input validation.
Input validation is the process of checking if user input [1] the expected format.
Input validation ensures the data entered by users matches the expected format to prevent errors or attacks.
Complete the sentence to explain input sanitization.
Input sanitization means removing or encoding [1] characters from user input to prevent security issues.
Sanitization removes or changes dangerous characters that could harm the system or cause attacks.
Fix the error in the sentence about input validation.
Input validation should be done only [1] the data is stored in the database.
Input validation must happen before storing data to ensure only correct and safe data is saved.
Fill both blanks to complete the sentence about sanitization methods.
Sanitization can be done by [1] dangerous characters or [2] them to safe forms.
Sanitization involves removing harmful characters or encoding them so they cannot cause harm.
Fill all three blanks to complete the dictionary comprehension about input validation.
valid_inputs = {input: input[1] for input in inputs if len(input) [2] 0 and input.isalnum() [3] True}This code strips whitespace, checks input length is greater than zero, and confirms input is alphanumeric.