title: How do you print superscript in Python?
body: <p>I am aware of the \xb function in python, but it does not seem to work for me. I am aware that I may need to download a third party module to accomplish this, if so, which one would be best?</p>
  <p>I am currently writing a binomial expansion solver, to try and use skills which I am teaching myself. The problem arises when I attempt to display the user input-ed expansion to the use for confirmation. Currently I am having to print the expression like so:</p>
  <pre><code>var1 = input(&quot;Enter a: &quot;)
  var2 = input(&quot;Enter b: &quot;)
  exponent = input(&quot;Enter n: &quot;)
  
  a = int(var1)
  b = int(var2)
  n = int(exponent)
  
  expression = ('(%(1)dx%(2)d)^%(3)d') %\
  {'1' : a, '2' : b, '3' : n}
  
  print(expression)
  
  confirmation = input(str(&quot;Is this correctt? Y/N &quot;))
  </code></pre>
  <p>This prints (2x4)^5, whereas I'd prefer the index to be printed as superscript. How can this be done?</p>