Ask Your Question

Vishnu Namboothiri's profile - activity

2020-08-03 14:36:34 +0200 answered a question How to output 'decimal' numbers in different radix.

The following function converts integers in any base to any other base:

def base_conversion(number, base_from, base_to):
    if(base_from==10):
        return (number.str(base=base_to))
    else:
        decimal = Integer(str(number), base=base_from)
        return (decimal.str(base=base_to))