8 lines
215 B
Python
8 lines
215 B
Python
def to_string(n,base):
|
|
conver_tString = "0123456789ABCDEF"
|
|
if n < base:
|
|
return conver_tString[n]
|
|
else:
|
|
return to_string(n//base,base) + conver_tString[n % base]
|
|
|
|
print(to_string(2835,16)) |