🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: XSS: all 10 questions

Quiz: XSS · Question 8 of 10

What does this print? (code)

What does this print?

from html import escape
print(escape('<b>"Hi"</b>'))
  1. A.<b>"Hi"</b>
  2. B.<b>"Hi"</b>
  3. C.<b>"Hi"</b>
  4. D.It raises an error
Answer & explanation

Correct answer: <b>"Hi"</b>

escape encodes <, >, & and, by default, quotes too.

Can you get the rest right without peeking?

Take the timed Quiz: XSS quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →