Your experience on this site will be improved by allowing cookies. HTML Character entities - http://www.chucke.com/entities.html. Description. mostly what i want to know is how to use string.replace(); since thats what this exercise seems to be about. Update1: Thanks bucabay again for the || - hint, Update2: Updated entity table with amp,lt,gt,apos,quot, thanks So in python 3.4 you can: Use html.escape(text).encode('ascii', 'xmlcharrefreplace').decode() to convert special characters to HTML entities. Using escape() should work with the character code range 0x00 to 0xFF (UTF-8 range). I hope it fulfills the purpose you're looking to utilize them for. Escaping HTML entities in JavaScript string literals within the