python海龟绘图画魔鬼鱼
时间: 2023-06-23 10:55:27 浏览: 127
好的,以下是使用Python海龟绘图库画魔鬼鱼的代码:
```python
import turtle
# 设置画笔
turtle.pensize(5)
turtle.pencolor("red")
turtle.speed(10)
# 画鱼身
turtle.fillcolor("yellow")
turtle.begin_fill()
turtle.circle(100, 80)
turtle.circle(300, 40)
turtle.circle(120, 80)
turtle.circle(300, 40)
turtle.end_fill()
# 画鱼鳍
turtle.penup()
turtle.goto(-75, 125)
turtle.pendown()
turtle.fillcolor("orange")
turtle.begin_fill()
turtle.setheading(150)
turtle.circle(100, 30)
turtle.circle(50, 60)
turtle.circle(100, 30)
turtle.end_fill()
turtle.penup()
turtle.goto(-75, -125)
turtle.pendown()
turtle.fillcolor("orange")
turtle.begin_fill()
turtle.setheading(-150)
turtle.circle(100, 30)
turtle.circle(50, -60)
turtle.circle(100, 30)
turtle.end_fill()
# 画鱼眼
turtle.penup()
turtle.goto(0, 0)
turtle.pendown()
turtle.fillcolor("white")
turtle.begin_fill()
turtle.circle(30)
turtle.end_fill()
turtle.penup()
turtle.goto(0, 10)
turtle.pendown()
turtle.fillcolor("black")
turtle.begin_fill()
turtle.circle(15)
turtle.end_fill()
# 隐藏画笔
turtle.hideturtle()
# 结束
turtle.done()
```
运行上述代码,将会显示出一只可爱的魔鬼鱼。
阅读全文