Binary to decimal
Level EASY
Given a binary number as an integer N, convert it into decimal and print.
Input format :
Output format :
Constraints :
Sample Input 1 :
Sample Output 1 :
Sample Input 2 :
Sample Output 2 :
7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pip._vendor.distlib.compat import raw_input | |
num=input() #101010101 | |
print(int(num,2)) | |
n, k = raw_input().split(" ") | |
n = int(n) | |
k = int(k) |
Comments
Post a Comment
Please give us your valuable feedback