Question: Consider the following Python code snippet used to sanitize user input: user _ input = input ( Enter your input: ) sanitized _
Consider the following Python code snippet used to sanitize user input:
userinput inputEnter your input:
sanitizedinput htmlescapeuserinput
printSanitized input:", sanitizedinput
Which of the following best describes the purpose of the htm L escape function in this code?
a It encrypts the user input to protect it from unauthorized access.
b It converts special characters to HTML entities to prevent crossside scripting.
c It validates the user input against a predefined set of rules.
d It removes leading and trailing whitespace from the user input.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
