12345678910111213141516171819 |
- def convert_base_2_to_16(number):
- """
- Given a number represented as base 2, convert it to base 16.
- To solve this task properly, you should convert directly from
- one base to the other without computing the whole number.
- >>> convert_base_2_to_16([0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0])
- [3, 0, 0, 14]
- >>> convert_base_2_to_16([0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0])
- [6, 0, 8, 6]
- >>> convert_base_2_to_16([0, 0, 1])
- [1]
- >>> convert_base_2_to_16([1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1])
- [1, 6, 10, 1]
- """
- # Your code here...
|