This code converts from decimal(base 10/ what you use everyday) to hexadecimal(base 16)
print("Please enter a number under 35535") theirNumber = input() printables = ["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"] for n in reversed(range(4)): for i in reversed(range(16)): if int(theirNumber) >= 16**n * i: print(printables[i], end="") theirNumber = int(theirNumber) - 16**n * i break else: continue