SyntaxFix
Write A Post
Hire A Developer
Questions
eumiro's answer is better, however I'm just posting this for variety:
>>> "%08d" % int(bin(6)[2:]) 00000110