## Python brush title-01 string

DaLongggggg 2021-04-06 18:10:15
python brush title-01 title string

# Problem description

For length is 5 One of the bits 01 strand , Everyone can be 0 or 1, Altogether 32 Maybe . The first few of them are ：

00000

00001

00010

00011

00100

Please output this in order of small to large 32 Kind of 01 strand .

# Output format

Output 32 That's ok , The length of each line in the order from small to large is 5 Of 01 strand .

# Sample output

00000000010001000011< The following parts are omitted >

``for i in range(0,32): a=str(bin(i)[2:]) a='0000'+a print(a[-5:])``

Because the output is 01 character string It can be used directly bin turn 1-32 The binary format of is directly used bin() The conversion will have 0b start [2:] Cut off the beginning and ask for output 5 position 01 character 0 After transformation, only 0 1 Only 1 31 by 11111 So add... Before output 0000 When output, take five bits from back to front [-5:] that will do

https://pythonmana.com/2021/04/20210406180452167l.html