Printing subscript in python
If all you care about are digits, you can use the str.maketrans() and str.translate() methods: Which will output: Note that this won’t work in Python 2 – see Python 2 maketrans() function doesn’t work with Unicode for an explanation of why that’s the case, and how to work around it.