追追比

导航

六角形的绘制

from turtle import*

#第一个三角形

seth(90)
fd(300)
seth(-30)
fd(300)
seth(-150)
fd(300)

#第二个三角形
seth(0)
penup()
fd((300*1.732/2)*2/3)  #运行到三角形左下的第一条边的三分之二处
pendown()
seth(90)
fd(300)
seth(-150)
fd(300)
seth(-30)
fd(300)

 

posted on 2020-10-19 19:10  追追比  阅读(432)  评论(0)    收藏  举报