2 回答

TA貢獻1848條經(jīng)驗 獲得超10個贊
將您的打印命令替換為:
Python 3.6+:
print(f'{item.text:<25} {item.next_sibling}')
Python 3 - 3.5:
print('{:<25} {}'.format(item.text, item.next_sibling))
輸出:
District: AnyState - At Large
Political Highlights: AnyTown City Council, 19XX-XX
Born: June X, 19XX; AnyTown, Calif.
Residence: Some Town
Religion: Episcopalian
Family: Wife, Some Name; two children
Education: Some State College, A.A. 19XX; Some Other State College, B.A. 19XX
Elected: 19XX
添加回答
舉報