“無輸出”可能意味著窗口正在自動關閉。嘗試將此添加到末尾以防止: # ...bob.hideturtle()input('press enter to exit') 你可以通過傳送到你想要繪制每個形狀的地點,多次繪制相同的形狀。 def shape(): for i in range(18): bob.left(140) bob.forward(100)# coordinates of each of the shapes# these are completely arbitrary# you can change these to whatever (adjust spacing, change where they are, etc)# you can also write this using ranges if you wantfor x in (-100, 0, 100, 200): for y in (-150, -50, 50, 150): bob.penup() bob.setposition(x, y) bob.pendown() shape() 這將循環通過所有16個點,-100, -150,-100, -50,-100, 50。。。,200, 150. 請注意,我將您的形狀更改為僅循環18次-這使總旋轉為360度的倍數,因此下一個形狀不會傾斜。此外,該形狀只