diff --git a/all-your-base/all_your_base.py b/all-your-base/all_your_base.py index 93e5e30..ff8d59c 100644 --- a/all-your-base/all_your_base.py +++ b/all-your-base/all_your_base.py @@ -6,17 +6,19 @@ def rebase(input_base: int, digits: list[int], output_base: int): """ - Convert a non-negative integer represented as digits in one base to digits in another base. + Convert a non-negative integer represented as digits in one base + to digits in another base. :param int input_base: Base of the input digits; must be >= 2. - :param list[int] digits: Sequence of digits where each d satisfies 0 <= d < input_base. - Leading zeros are allowed; an empty list denotes 0. + :param list[int] digits: Sequence of digits where each d satisfies + 0 <= d < input_base. Leading zeros are allowed; + an empty list denotes 0. :param int output_base: Base for the output digits; must be >= 2. - :returns: Digits of the same number in ``output_base``, without leading zeros - (except ``[0]`` for zero). + :returns: Digits of the same number in ``output_base``, without leading + zeros (except ``[0]`` for zero). :rtype: list[int] - :raises ValueError: If ``input_base < 2``, if any digit violates ``0 <= d < input_base``, - or if ``output_base < 2``. + :raises ValueError: If ``input_base < 2``, if any digit violates + ``0 <= d < input_base``, or if ``output_base < 2``. """ # for input.