Using this code also works:
print('\N{GREEK SMALL LETTER PI}r\N{SUPERSCRIPT TWO}')
print('\N{GREEK CAPITAL LETTER THETA}r\N{SUBSCRIPT TWO}')
The output is:
πr²
Θ₂
Note that this only works on Python versions 3.3 and higher. Unicode formatting.
source
share