标签:forward style 图片 mamicode alt war com LLC hit
1.五角星
import turtle turtle.fillcolor("red") turtle.begin_fill() count = 1 while count <= 5: turtle.forward(100) turtle.right(144) count += 1 turtle.end_fill()
2.六角形
import turtle turtle.pensize(2) turtle.fillcolor("white") turtle.begin_fill() turtle.right(330) turtle.forward(200) for i in range(2): turtle.right(120) turtle.forward(300) turtle.right(120) turtle.forward(100) turtle.right(300) turtle.forward(100) for i in range(3): turtle.right(120) turtle.forward(300) turtle.end_fill() turtle.hideturtle() turtle.done()
3.叠加等边三角形
import turtle turtle.pensize(2) turtle.fillcolor("white") turtle.begin_fill() for i in range(3): turtle.forward(100) turtle.right(120) turtle.right(300) turtle.forward(100) for i in range(3): turtle.right(120) turtle.forward(200) turtle.end_fill() turtle.hideturtle() turtle.done()
标签:forward style 图片 mamicode alt war com LLC hit
原文地址:https://www.cnblogs.com/cjl1124/p/12490548.html