turtle库画叠加三角形

import turtle as tt
import time

tt.fillcolor('red')
tt.begin_fill()

for _ in range(3):
    tt.forward(100)
    if abs(tt.pos())<1:
        break
    tt.right(120)

tt.right(60)
tt.forward(100)
for _ in range(3):
    tt.right(120)
    tt.forward(200)

tt.end_fill()
time.sleep(5)

 

 

posted @ 2020-09-15 16:54  我的人生不止一部戏  阅读(343)  评论(0)    收藏  举报