s = '' print((“ ”).center(9)) for i in range(2,10,2): t = (9-i) print ((''t+st+''t).center(9)) 運行效果如下: 圖片發(fā)自簡書App