print u'<'
How can I print <
print '>'
How can I print >
We can convert numbers to strings through using the str() method. We'll pass either a number or a variable into the parentheses of the method and then that numeric value will be converted into a string value. The quotes around the number 12 signify that the number is no longer an integer but is now a string value.
In Python an integer can be converted into a string using the built-in str() function. The str() function takes in any python data type and converts it into a string.
Save this answer. Show activity on this post. < stands for lesser than (<) symbol and, the > sign stands for greater than (>) symbol .
You should use HTMLParser
module to decode html:
>>> import HTMLParser
>>> h= HTMLParser.HTMLParser()
>>> h.unescape('alpha < β')
u'alpha < \u03b2'
To escape HTML, cgi module is fine:
>>> cgi.escape(u'<a>bá</a>').encode('ascii', 'xmlcharrefreplace')
'<a>bá</a>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With