def f(x, a, b):
x = int(str(x), a)
s = ''
while x > 0:
s += str(x % b)
x //= b
return s[::-1]
x = f(A13, 16, 10)
print(x)
def convert_radix(source_number_str, source_radix, destination_radix):
number = int(source_number_str, source_radix)
result = ''
while source_number > 0:
result += str(number % destination_radix)
number //= destination_radix
return result[::-1]
x = convert_radix('A13', 16, 10)
print(x) # 2579