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:
user_input = input("Enter your input: ")
sanitized_input = html.escape(user_input)
print("Sanitized input:", sanitized_input)
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.
 Consider the following Python code snippet used to sanitize user input:

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!