>>> num = 42 >>> N = 10 >>> print("{i:{fill}{width}b}".format(i=num, fill='0', width=N)) 0000101010
タグ: