Binär bis Dezimal in Python
int(binaryString, 2)
Bored Bison
int(binaryString, 2)
a = 10
#this will print a in binary
bnr = bin(a).replace('0b','')
x = bnr[::-1] #this reverses an array
while len(x) < 8:
x += '0'
bnr = x[::-1]
print(bnr)
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
format(decimal ,"b")