LearnPy Hub
← Data Types & Casting problems
Medium

Read a Number in Any Base

Read a number written in base b (as text) and b itself. Print its value in base 10 using int(text, b).

Input

The number, then b (2–36).

Output

One integer.

Sample 1

Input
1010
2
Output
10

Sample 2

Input
ff
16
Output
255
solution.py
Output appears here
Read a Number in Any Base · Python practice problem · LearnPy Hub