THE CHALLENGEBASE_CONVERSION — A number from one base to another.
Read a number (possibly written with the digits 0 to 9 and the letters A to F), the base b1 it is written in, then a base b2 (2 <= b1, b2 <= 16) and print the number in base b2.
Input:
1010
2
10
Output:
10
Challenge: int(text, base) to read, ONE while to write - bin(), hex(), oct() and format() are not allowed.
Checks (verified automatically before your code runs):
- At least 1 while loop.
- Do not use bin().
- Do not use hex().
- Do not use format().