帮我写一个python画杰尼龟的代码
时间: 2024-03-02 21:27:58 浏览: 190
好的,下面是Python代码实现:
```
import turtle
# 绘制身体
turtle.penup()
turtle.goto(0, -150)
turtle.pendown()
turtle.begin_fill()
turtle.color("yellow")
turtle.circle(150)
turtle.end_fill()
# 绘制眼镜蛇形状
turtle.penup()
turtle.goto(0, -50)
turtle.pendown()
turtle.begin_fill()
turtle.color("green")
turtle.left(90)
turtle.circle(-100, 60)
turtle.left(120)
turtle.circle(-100, 60)
turtle.end_fill()
# 绘制眼睛
turtle.penup()
turtle.goto(0, 25)
turtle.pendown()
turtle.begin_fill()
turtle.color("white")
turtle.circle(30)
turtle.end_fill()
turtle.penup()
turtle.goto(0, 50)
turtle.pendown()
turtle.begin_fill()
turtle.color("black")
turtle.circle(10)
turtle.end_fill()
# 绘制嘴巴
turtle.penup()
turtle.goto(0, -80)
turtle.pendown()
turtle.width(10)
turtle.color("red")
turtle.right(90)
turtle.circle(80, 180)
turtle.done()
```
运行以上代码即可绘制出一个杰尼龟的形状。
阅读全文