Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
binary
#python 2.7.12 def convert(n): if n == 0: return "0" pstr = '' while n: if n & 1 == 1: pstr = "1" + pstr else: pstr = "0" + pstr n /= 2 return pstr binaryNum = 6 print 'Entered Binary Number = ', binaryNum print 'Binary Representation = ',convert(binaryNum)
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
Prime number finder and counter in range (ex: 0-100) using python
test
rString__1
Speed up Python2 nested loops with XOR
u
Problem: rstring
1 to 101 : Decimal, Octal, Hexadecimal and Binary Format
binary
Lambda
http_request
Please log in to post a comment.