Skip to content

Instantly share code, notes, and snippets.

@metric-space
Created July 28, 2025 22:42
Show Gist options
  • Select an option

  • Save metric-space/5382c22c1846a1116d886c5a08ee7622 to your computer and use it in GitHub Desktop.

Select an option

Save metric-space/5382c22c1846a1116d886c5a08ee7622 to your computer and use it in GitHub Desktop.
def superscript(exp):
sup_map = str.maketrans("0123456789-", "⁰¹²³⁴⁵⁶⁷⁸⁹⁻")
return f"10{str(exp).translate(sup_map)}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment