def ss(n, c):
d = [] while 1: z = divmod(n, c) d.append(divmod(n, c)) n = z[0] if n == 0: break outd = [] for i in d: outd.append(i[1]) outd.reverse() sss = "" for j in outd: sss += str(j) print 'system:', c,'\t', sss print
n = raw_input("Enter number: ") n = int(n) print for i in range(2, 10): ss(n, i) print 'system 16:', '\t', hex(n)[2:] raw_input()
|