Home > other >  Python decimal to binary, and high fill 0, no built-in functions.
Python decimal to binary, and high fill 0, no built-in functions.

Time:10-03

N=int (input ())
A=[]
While n!=0:
Anderson, nsert (0, n % 2)
N/2
/=For I in a:
Print (I, end="")
This is I do turn the decimal binary
But not high fill 0

CodePudding user response:

N=int (input ())
A=[]
While n!=0:
Anderson, nsert (0, n % 2)
N/2
/=For I in range (len (a), 8) :
Print (0, end="")
A for b in a:
Print (b, end="")


No one help me
But I found the answer
But I don't know what's wrong

CodePudding user response:

Covering just formatting:
 print (" {: 0 & gt; 8} ". The format (digital)) 
  • Related