base convert by govind

while 1:\x0d
 s=raw_input().split()\x0d
 n=int(s[0])\x0d
 b=int(s[1])\x0d
 l=[]\x0d
 while n>=b:\x0d
  l+=[str(n%b)]\x0d
  n=n/b\x0d
 if n>0:l+=[str(n)]\x0d
 l.reverse()\x0d
 print''.join(l)

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return top