How do you print superscript?

You need to use a ‘format’ type thing. Use {}\u00b2".format(area))" and the{}becomes a²`. Here is an example:

print("The area of your rectangle is {}cm\u00b2".format(area))

The end of the code will print cm². You can change the large 2 at the end to other numbers for a different result.
I do not know how to do a lower subscript though.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)