Generation

generate functionMon, 12 Dec 2022

Your mission is to implement a function that converts the following potentially harmful characters: < --> &lt; > --> &gt; " --> &quot; & --> &amp; Good luck :D

def html_escape(text): text = text.replace('<', '&lt;') text = text.replace('>', '&gt;') text = text.replace('"', '&quot;') text = text.replace('&', '&amp;') return text

Questions about programming?Chat with your personal AI assistant