Unicode subscript python format('\N{SUPERSCRIPT LATIN SMALL LETTER N}') # superscript n Here's a list of all Unicode Characters In Python, you can achieve superscript and subscript formatting using Unicode characters or HTML tags. ). Method 1: Using Unicode Characters. Do the following: Press Alt+F2; Type "charmap" On doing so, you'll get tons of characters including subscripts, superscripts, etc. Now that we have a clear picture of superscript and subscript, let's understand how to print them in Python. 1. g 1,2,A,B. To print superscript and subscript text in Python, you can use Unicode characters or formatting options provided by libraries. One way to create subscripts and superscripts in strings is to use unicode and concatenate. (e. The following table gives unicode subscript and superscript values that you may often needc character In Python 3, you can use the Unicode escape sequence “\u” followed by the hexadecimal representation of the Unicode character to display superscripts and subscripts. format('\N{LATIN SUBSCRIPT SMALL LETTER X}') # subscript x "C{}". Using Unicode characters: - Superscript: You can represent superscript characters by using the corresponding Unicode code points and printing them as regular text. There are 2 main methods that we can use to print subscripts to the console window in Python; the Unicode method and the escape sequence. If the terminal supports unicode (most do nowadays) you can use unicode's subscripts. For example, the Unicode character for superscript “2” is “²” (U+00B2), and the Unicode character for subscript “2” is “₂” (U+2082). g H₂) Namely the subscripts are in the ranges: 0x208N for numbers, +, -, =, (, ) (N goes from 0 to F) 0x209N for letters; For example: In [6]: print(u'H\u2082O\u2082') H₂O₂ Unicode characters allow us to easily display superscript and subscript numbers in Python. The output performed on the console is simple text. you can use superscript and subscript and pass the UNICODE for the character you want "A{}". By using specific Unicode symbols, we can directly include these characters in our strings without needing additional libraries. . format('\u00B2') # superscript 2 "B{}". Here are a few approaches: Superscript: Use the Unicode representation of superscript numbers or characters. On the bottom left end of the window, you'd see something like 'U-xxxx' where x can be any alpha-numeric character(e. There is a very easy way to print superscripts and subscripts using Unicode characters. Unicode is a standardized system that is accepted worldwide for character encoding of text expressed in most of the writing systems available. The output performed on the console is simple text. txkqtnbjamwxukqhzwysyavqwgmzyqvouzcqyiiczjuixlxkyspowvycttf