Simple Python Scripts
Scripts for simple Python programs
Thursday, 3 November 2016
Convert a number to BINARY DIGIT
d=1
bin=0
n=int(input("enter no.:"))
while(n!=0):
r=n%2
bin=r*d+bin
d=d*10
n=n//2
print(bin)
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment