title: Python convert decimal to hex
body: <p>I have a function here that converts decimal to hex but it prints it in reverse order. How would I fix it?</p>
  
  <pre><code>def ChangeHex(n):
      if (n &lt; 0):
          print(0)
      elif (n&lt;=1):
          print(n)
      else:
          x =(n%16)
          if (x &lt; 10):
              print(x), 
          if (x == 10):
              print("A"),
          if (x == 11):
              print("B"),
          if (x == 12):
              print("C"),
          if (x == 13):
              print("D"),
          if (x == 14):
              print("E"),
          if (x == 15):
              print ("F"),
          ChangeHex( n / 16 )
  </code></pre>