# Convert a binary number to a decimal number using Math Module

QUESTION: Convert a binary number to a decimal number. (with math module)

ANSWER PARAMETER: Use of the built-in functions found in the math module as well as lists (remember to import the math module into your program!).

This where I am lost.

Without the answer parameter, I can convert to a binary to decimal But I don't understand how to use the math module to get the same answer.

Converting binary to decimal without using math module.

``````print("Covert binary to decimal (Example: 1011 = 11)");
binary = input("Enter number in Binary Format: ");
try:
#convert input to integer
binary_con = int(binary)
#convert binary to decimal
decimal = int(binary, 2);
#print decimal
print(binary,"in Decimal =",decimal);
#if error print input number is not a interger(1 or 0)
except ValueError:
#print message input number is not binary
print("That's not a Binary number")
``````

Then what would I use to get the same result? Thank you in advance for any help.