import turtle as t
t.penup()
t.fd(-200)
t.write("一朵小花\n", align="right", font=("楷体", 16, "bold"))
def draw_leaf():
for i in range(2):
for j in range(15):
t.forward(5)
t.right(6)
t.right(90)
t.goto(0,-150)
t.left(90)
t.down()
t.forward(50)
t.fillcolor("green")
t.begin_fill()
draw_leaf()
t.end_fill()
t.forward(50)
t.right(270)
t.fillcolor("green")
t.begin_fill()
draw_leaf()
t.end_fill()
t.right(90)
t.forward(130)
t.fillcolor("red")
t.begin_fill()
for i in range(6):
draw_leaf()
t.right(60)
t.end_fill()
t.done()
Python-绘制花朵
于 2022-05-24 15:24:15 首次发布