Given a number and its base, the task is to convert the given number into its corresponding decimal number. The base of number can be anything like digits between 0 to 9 and A to Z. Where the value of A is 10, value of B is 11, value of C is 12 and so on.
Input : '1011' base = 2 Output : 11 Input : '1A' base = 16 Output : 26 Input : '12345' base = 8 Output : 5349
- Given number in string form and base
- Now call the builtin function int(‘number’, base) by passing the two parameters any base number in String form and base of that number and store the value in temp
- Print the value temp
- How to compute natural, base 10, and base 2 logarithm for all elements in a given array using NumPy?
- What is the meaning of invalid literal for int() with base = ' '?
- String to Int and Int to String in Python
- Python program to convert float decimal to Octal number
- Python program to convert decimal to binary number
- Python program to convert hex string to decimal
- Python Program to Convert any Positive Real Number to Binary string
- Quickly convert Decimal to other bases in Python
- Convert Decimal to String in Python
- How to convert Float to Int in Python?
- Selenium Base Mini Project Using Python
- Python Program for Print Number series without using any loop
- Converting Roman to Decimal in Python using gnboorse-rom module
- Python | Pandas TimedeltaIndex.base
- numpy.dtype.base() function - Python
- Abstract Base Class (abc) in Python
- Python | Decimal compare() method
- Python | Decimal is_subnormal() method
- Python | Decimal logb() method
- Python | Decimal conjugate() method
Improved By : Akanksha_Rai