六角形的绘制
import turtle as t
for i in range(6):
t.fd(50)
#海龟向左旋转120°
t.left(120)
t.fd(50)
t.left(120)
t.fd(50)
t.left(120)
t.fd(50)
t.right(60)
t.hideturtle()
如图所示:
![](https://img-blog.csdnimg.cn/img_convert/92774a396c83531475e9396147cf9919.png)
无角正方形的绘制
import turtle as t
for i in range(4):
t.up()
t.fd(50)
t.down()
t.fd(50)
t.up()
t.fd(50)
t.down()
t.left(90)
t.hideturtle()
如图所示:
![](https://img-blog.csdnimg.cn/img_convert/fef55d8ef4918533e5ac2feb71fea022.png)