In order to convert an integer to a binary, I have used this code :
>>> bin(6)
'0b110'
and when to erase the ‘0b’, I use this :
>>> bin(6)[2:]
'110'
What can I do if I want to show 6
as 00000110
instead of 110
?
In order to convert an integer to a binary, I have used this code :
>>> bin(6)
'0b110'
and when to erase the ‘0b’, I use this :
>>> bin(6)[2:]
'110'
What can I do if I want to show 6
as 00000110
instead of 110
?