`
belldeep
  • 浏览: 39373 次
  • 性别: Icon_minigender_1
  • 来自: 广州
社区版块
存档分类
最新评论

python : turtle 画正六边形 hexagon comb

阅读更多
draw_comb2.py
# -*- coding: cp936 -*-
# 画2圈蜂巢形 hexagon comb
import turtle

window = turtle.Screen()
t=turtle.Pen()

L = 50  # 画线长度
for h in range(6):
    for i in range(6):
        for j in range(6):
            t.forward(L)
            t.right(60)
        t.forward(L)
        t.left(60)
    t.forward(L)
    t.right(60)
#
window.exitonclick()

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics