Binary to Decimal @ Dcoder

in #programming11 months ago

Problem: Write a code which converts a binary number (written as string) into a decimal number.
Input: Input is a binary number.
Output: The output is a decimal number.(interger value)
Constraints: The binary number is non-negative and the resultant decimal number is an integer.
Sample Input: 101
Sample Output:
5

print(int(input(), 2))