2 odpowiedzi
+ 4
victor bamidele , a binary number will mostly be shown in string format, as leading zeros's can not be represented in int format. To convert int representation to string you can use str() function. to fill leading zeros you can use string method rjust(<binary string>, <fill character>).
Please do a try, if you feel a problem come back.
bin = 100110
print(str(bin).rjust(8,"0")
If this is not the answer you expect, please make a sample of input, and a sample how the output should look like.