For a 01 string with a length of 5 digits, each digit may be 0 or 1, and there are a total of 32 possibilities. The first few of them are: 00000 00001 00010 00011 00100 Please output these 32 types in ascending order

for i in range(32):
    a='{0:0>5b}'.format(i)
    print(a)              

Insert picture description here

Guess you like

Origin blog.csdn.net/jiahuiandxuehui/article/details/115209350