用python画梅花鹿
时间: 2023-10-22 13:09:52 浏览: 36
好的,以下是使用Python绘制梅花鹿的代码:
```
import turtle
t = turtle.Turtle()
t.hideturtle()
t.getscreen().bgcolor("#994444")
# 绘制梅花鹿
t.penup()
t.goto(0, -150)
t.pendown()
t.pensize(10)
# 绘制梅花鹿的头部
t.circle(100)
# 绘制梅花鹿的耳朵
t.penup()
t.goto(-50, 50)
t.pendown()
t.fillcolor("#ffffff")
t.begin_fill()
t.circle(20)
t.end_fill()
t.penup()
t.goto(50, 50)
t.pendown()
t.fillcolor("#ffffff")
t.begin_fill()
t.circle(20)
t.end_fill()
# 绘制梅花鹿的眼睛
t.penup()
t.goto(-25, 80)
t.pendown()
t.fillcolor("#ffffff")
t.begin_fill()
t.circle(8)
t.end_fill()
t.penup()
t.goto(25, 80)
t.pendown()
t.fillcolor("#ffffff")
t.begin_fill()
t.circle(8)
t.end_fill()
# 绘制梅花鹿的鼻子
t.penup()
t.goto(0, 60)
t.pendown()
t.fillcolor("#773333")
t.begin_fill()
t.circle(12)
t.end_fill()
# 绘制梅花鹿的身体
t.penup()
t.goto(0, -50)
t.pendown()
t.fillcolor("#994444")
t.begin_fill()
t.circle(150)
t.end_fill()
t.penup()
t.goto(0, -150)
t.pendown()
t.fillcolor("#ffffff")
t.begin_fill()
t.circle(120)
t.end_fill()
# 绘制梅花鹿的腿
t.penup()
t.goto(-70, -120)
t.pendown()
t.fillcolor("#773333")
t.begin_fill()
t.forward(80)
t.right(90)
t.forward(30)
t.right(90)
t.forward(80)
t.right(90)
t.forward(30)
t.end_fill()
t.penup()
t.goto(70, -120)
t.pendown()
t.fillcolor("#773333")
t.begin_fill()
t.forward(80)
t.right(90)
t.forward(30)
t.right(90)
t.forward(80)
t.right(90)
t.forward(30)
t.end_fill()
turtle.done()
```
希望能帮到您!