bobby7
bobby7

Reputation: 21

Pygame: display exponent in text

I cant seem to figure out how to write 3^3 without the up pointing arrow. as i am making a mainly text-based program it's just going to look ugly.

I have not tried to do much yet. I am mainly making this post for others to find, i will probably find the solution myself, but any help is appreciated.

So my question is: can i write something in my string that will enable exponents? if not, will i have to write my own string interpreter?

Upvotes: 0

Views: 320

Answers (1)

bobby7
bobby7

Reputation: 21

Seems this can be done with

f'string morestring \N{SUPERSCRIPT x}'

x here is the letter version of the number.

SUBSCRIPT also works.

answer found here https://stackoverflow.com/a/49442772/9777524

Upvotes: 1

Related Questions