123456789101112131415161718 |
- def convert_base(number):
- """
- Given a number represented as a list of digits in a base,
- convert it to the same number written as a list of digits in the other base.
- >>> convert_base([5, 9, 5, 7], 10, 6)
- [4, 3, 3, 2, 5]
- >>> convert_base([0, 0, 3, 2, 3, 3], 5, 20)
- [1, 2, 3]
- >>> convert_base([1, 2, 1, 0], 3, 17)
- [2, 14]
- >>> convert_base([1, 2, 1, 6], 7, 5)
- [3, 3, 0, 4]
- """
- # Your code here...
|