Answers for "convert integer to any base in python"

0

python convert number to base

def numberToBase(n, b):
    if n == 0:
        return [0]
    digits = []
    while n:
        digits.append(int(n % b))
        n //= b
    return digits[::-1]
Posted by: Guest on September-12-2021

Code answers related to "convert integer to any base in python"

Python Answers by Framework

Browse Popular Code Answers by Language