Here is my code so far:
import string
def convert(num,base):
if num==0:
return
else:
remainder = num%base
num = num//base
b=(str(remainder))
print(b[::-1],end="")
return convert(num,base)
Instead of printing this:
>>> convert(29,3)
2001
I need to print it backward like this (and it needs to be done by strings):
>>> convert(29,3)
1002
Seems like string does not work well with recursion:
>>> convert(29,3)
('2', ('0', ('0', ('1', None))))