当前位置:首页 / 文章测试 / 六芒星

六芒星

开始打字练习

import turtle as t

t.speed(0)

t.hideturtle()

t.penup()

t.goto(150,8)

t.setheading(90)

t.pendown()

# 绘制六芒星中间的正六边形

t.fillcolor('red')

t.begin_fill()

t.circle(150,360,6)

t.end_fill()

# 绘制六芒星的六个角

t.setheading(0)

t.pencolor('white')

t.fillcolor('green')

for i in range(6): # 循环6次画6个三角形

t.begin_fill()

t.setheading(60*(i+1))

t.forward(150)

t.left(120)

t.forward(150)

t.end_fill()

声明:以上文章均为用户自行发布,仅供打字交流使用,不代表本站观点,本站不承担任何法律责任,特此声明!如果有侵犯到您的权利,请及时联系我们删除。

本文打字速度TOP10

  • 暂无打字数据!