一朵鲜艳的玫瑰花
import turtle
turtle.speed(5) # 设置画笔的移动速度
# 初始位置
turtle.penup() # 抬起画笔,不绘制图形,另起一个地方绘制
turtle.left(90) # 逆时针移动90°
turtle.fd(200) # 向当前画笔方向移动200像素长度
turtle.pendown() # 移动时绘制图形,缺省时也绘制
turtle.right(90) # 顺时针移动90°
# 花蕊
turtle.fillcolor("red") # 绘制图形的填充颜色
turtle.begin_fill() # 准备开始填充图形
# 画圆,半径为正(负),表示圆心在画笔的左(右)边画圆;10:表示半径,180:表示弧度
turtle.circle(10, 180)
turtle.circle(25, 110) # 半径为25,圆心在画笔的左边,弧度为110
turtle.left(50) # 逆时针移动50°
turtle.circle(60, 45) # 半径为60,圆心在画笔的左边,弧度为45
turtle.circle(20, 170)
turtle.right(24)
turtle.fd(30)
turtle.left(10)
turtle.circle(30, 110)
turtle.fd(20)
turtle.left(40)
turtle.circle(90, 70)
turtle.circle(30, 150)
turtle.right(30)
turtle.fd(15)
turtle.circle(80, 90)
turtle.left(15)
turtle.fd(45)
turtle.right(165)
turtle.fd(20)
turtle.left(155)
turtle.circle(150, 80)
turtle.left(50)
turtle.circle(150, 90)
turtle.end_fill() # 填充完成
# 花瓣1
turtle.left(150)
turtle.circle(-90, 70)
turtle.left(20)
turtle.circle(75, 105)
turtle.setheading(60) # 设置当前朝向为60°
turtle.circle(80, 98)
turtle.circle(-90, 40)
# 花瓣2
turtle.left(180)
turtle.circle(90, 40)
turtle.circle(-80, 98)
turtle.setheading(-83) # 设置当前朝向为-83°
# 叶子1
turtle.fd(30)
turtle.left(90)
turtle.fd(25)
turtle.left(45)
turtle.fillcolor("green") # 绘制图形的填充颜色
turtle.begin_fill() # 准备开始填充图形
turtle.circle(-80, 90)
turtle.right(90)
turtle.circle(-80, 90)
turtle.end_fill() # 填充完成
turtle.right(135)
turtle.fd(60)
turtle.left(180)
turtle.fd(85)
turtle.left(90)
turtle.fd(80)
# 叶子2
turtle.right(90)
turtle.right(45)
turtle.fillcolor("green") # 绘制图形的填充颜色
turtle.begin_fill() # 准备开始填充图形
turtle.circle(80, 90)
turtle.left(90)
turtle.circle(80, 90)
turtle.end_fill() # 填充完成
turtle.left(135)
turtle.fd(60)
turtle.left(180)
turtle.fd(60)
turtle.right(90)
turtle.circle(200, 60)
turtle.done()