Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
chr codes
#1
anyone know where I can find the code to get a superscript 2?

Thanks
Reply
#2
Is this for a terminal? HTML? Something else?

For character output, you could try using the codes in wikipedia and seeing if they render properly. In my terminal, 1, 2, and 3 are dissimilar to higher powers.

>>> 'X\u00B2 X\u00B3 X\u2074 X\u2075 X\u2079'
'X² X³ X⁴ X⁵ X⁹'
Reply
#3
Sorry,

I meant for the car() function
Reply
#4
Output:
>>> ord('²') 178 >>> chr(178) '²'
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020