Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

binary python

def bin(n):
    s=""
    while n!=0:
        if n%2==1:
            s+="1"
            n//=2
        elif n%2==0:
            s+='0'
            n//=2
    return s
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #binary #python
ADD COMMENT
Topic
Name
5+6 =