六角形的绘制
描述
使用turtle库绘制一个六角形,效果如下:
图中线条颜色、宽度、填充、箭头位置和风格不限。
输入
无
输出
如上图
代码如下:
import turtle
turtle.left(30)
turtle.forward(144)
turtle.right(60)
turtle.forward(144)
turtle.right(60)
turtle.forward(144)
turtle.right(60)
turtle.forward(144)
turtle.right(60)
turtle.forward(144)
turtle.right(60)
turtle.forward(144)
turtle.forward(144)
turtle.right(120)
turtle.forward(144)
turtle.left(60)
turtle.forward(144)
turtle.right(120)
turtle.forward(144)
turtle.left(60)
turtle.forward(144)
turtle.right(120)
turtle.forward(144)
turtle.left(60)
turtle.forward(144)
turtle.right(120)
turtle.forward(144)
turtle.left(60)
turtle.forward(144)
turtle.right(120)
turtle.forward(144)
turtle.left(60)
turtle.forward(144)
turtle.right(120)
turtle.forward(144)