How do you write a superscript and subscript in python? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 5

How do you write a superscript and subscript in python?

23rd May 2018, 7:41 PM
Osamudiamen Nwoko
Osamudiamen Nwoko - avatar
3 Answers
+ 3
By using str.maketrans() and str.translate() methods, like so: https://stackoverflow.com/questions/24391892/printing-subscript-in-JUMP_LINK__&&__python__&&__JUMP_LINK Please note that you can easily get answers to such questions using google; this was the first result :)
27th May 2018, 7:25 PM
Just A Rather Ridiculously Long Username
+ 1
Just A Rather Ridiculously Long Username To the defence of Charles , It is an interesting question. I looked up the answer only because it was posted on SL. this would not have happened if he just had googled it.
15th Sep 2018, 5:05 AM
ifl
ifl - avatar
0
In order to write superscripts and subscripts in python, we can easily use the '$\mathregular{Normal^{superscripts}}
#x27; and '$\mathregular{Normal_{subscripts}}
#x27;, respectively.
10th Jun 2021, 1:54 PM
Sara