1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
alph = "0123456789abcdefghijklmnopqrstuvwxy" def to10(s): return int(s, 35) def to35(s): q = s; o = "" while ( q > 0 ): rem = q % 35 o = alph[rem] + o q //= 35 return o print("Input: (base-10) 100\nOutput: ", to35(100)) print("Input: (base-35) 2u\nOutput: ", to10("2u"))