Skip to content

Commit 5577ea5

Browse files
committed
Update all_your_base.py
1 parent b10dd7c commit 5577ea5

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

all-your-base/all_your_base.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,19 @@
66

77
def rebase(input_base: int, digits: list[int], output_base: int):
88
"""
9-
Convert a non-negative integer represented as digits in one base to digits in another base.
9+
Convert a non-negative integer represented as digits in one base
10+
to digits in another base.
1011
1112
:param int input_base: Base of the input digits; must be >= 2.
12-
:param list[int] digits: Sequence of digits where each d satisfies 0 <= d < input_base.
13-
Leading zeros are allowed; an empty list denotes 0.
13+
:param list[int] digits: Sequence of digits where each d satisfies
14+
0 <= d < input_base. Leading zeros are allowed;
15+
an empty list denotes 0.
1416
:param int output_base: Base for the output digits; must be >= 2.
15-
:returns: Digits of the same number in ``output_base``, without leading zeros
16-
(except ``[0]`` for zero).
17+
:returns: Digits of the same number in ``output_base``, without leading
18+
zeros (except ``[0]`` for zero).
1719
:rtype: list[int]
18-
:raises ValueError: If ``input_base < 2``, if any digit violates ``0 <= d < input_base``,
19-
or if ``output_base < 2``.
20+
:raises ValueError: If ``input_base < 2``, if any digit violates
21+
``0 <= d < input_base``, or if ``output_base < 2``.
2022
"""
2123

2224
# for input.

0 commit comments

Comments
 (0)