Denary to Hexidecimal

A denary to hex converter is, as the name sugests a converter that terns 10th bace denary in to 16th bace hexidecimal
this code is very simple it only works for up to 255 or ff but it would be extreamly easy to change to do more or less remeber it it is also posibel to use the hex() function but i did it without also note how i use a function to restart and start the code.
here is some code that would work in python although keep in mind there are outher methods.

def den2hex():
 print("\033[31minput a number to be converted to hex (no bigger than 255)")
 numtohex = input("->>-")
 numtohex = int(numtohex.strip())
 hexhalf1 = numtohex // 16
 hexhalf1 = hexhalf1
 hexhalf2 = numtohex - (hexhalf1*16)
 hexhalf1 = str(hexhalf1)
 hexhalf2 = str(hexhalf2)

 if numtohex > 255:
  print("sorry that number is to big try again")
  den2hex()

 if hexhalf1 == "10":
  hexhalf1 = "a"
 elif hexhalf1 == "11":
  hexhalf1 = "b"
 elif hexhalf1 == "12":
  hexhalf1 = "c"
 elif hexhalf1 == "13":
  hexhalf1 = "d"
 elif hexhalf1 == "14":
  hexhalf1 = "e"
 elif hexhalf1 == "15":
  hexhalf1 = "f"

 if hexhalf2 == "10":
  hexhalf2 = "a"  elif hexhalf2 == "11":
  hexhalf2 = "b"
 elif hexhalf2 == "12":
  hexhalf2 = "c"
 elif hexhalf1 == "13":
  hexhalf2 = "d"
 elif hexhalf1 == "14":
  hexhalf2 = "e"
 elif hexhalf2 == "15":
  hexhalf2 = "f"
 elif hexhalf2 >= "16":

 print("the number ",numtohex," is ",hexhalf1,hexhalf2," in hex")
den2hex()