Shuvanon Razik's Blog
Wednesday, January 27, 2016
Convert decimal to binary in python
def dec_to_bin(x):
return int(bin(x)[2:])
n = int(raw_input())
while n>0:
inp=int(raw_input())
ans= dec_to_bin(inp)
print ans
No comments :
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments ( Atom )
No comments :
Post a Comment