Base conversion

Write codeMedium20 min

Your task

Given a non-negative number represented as an uppercase string num_str in base from_base, convert it to base to_base and return the result as an uppercase string. Both bases are between 2 and 16 inclusive; digits above 9 use letters A-F. The value fits in 64 bits. Zero must convert to the string '0'. For example ('FF', 16, 2) returns '11111111'.

Examples

convert_base(num_str: str, from_base: int, to_base: int) -> str
Example 1
Inputconvert_base("FF", 16, 2)
Output"11111111"