def convert_base(n, b): """ convert_base(integer, integer) -> string Return the textual representation of n (decimal) in base 2 <= b <= 36. """ assert 2 <= b <= 36 result = "" if n == 0: return "0" digits = "0123456789abcdefghijklmnopqrstuvwxyz" while n != 0: digit = n%b n = n//b #result = str(digit) + result result = digits[digit] + result return result