Divide by the base. The remainder is your least-significant digit. The quotient is the rest of the problem. Repeat for more significant digits until the number is zero.
def int_to_other_base(num, base): ans = [] while num > 0: num, remainder = divmod(num, base) ans.append(remainder) return ans[::-1] print(int_to_other_base(3600,36)) print(int_to_other_base(8,2))
Output:[2, 28, 0]
[1, 0, 0, 0]
36**2 = 1296. 2 times that is 2592. 36 * 28 is 1008. 1008 + 2592 is 3600. So in base 36, 3600 has digits of 2, 28, and 0.