六角形的绘制
描述
使用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)
本文为张军原创文章,转载无需和我联系,但请注明来自张军的军军小站,个人博客http://www.zhangjunbk.com