用pythen的turtle画一个鸡
时间: 2023-03-25 13:04:26 浏览: 214
好的,我可以回答这个问题。以下是用 Python 的 turtle 模块画鸡的代码:
```python
import turtle
# 画鸡头
turtle.penup()
turtle.goto(, 100)
turtle.pendown()
turtle.circle(50)
# 画鸡冠
turtle.penup()
turtle.goto(, 150)
turtle.pendown()
turtle.color("red")
turtle.begin_fill()
turtle.forward(25)
turtle.right(120)
turtle.forward(25)
turtle.right(120)
turtle.forward(25)
turtle.end_fill()
# 画鸡身
turtle.penup()
turtle.goto(, 50)
turtle.pendown()
turtle.color("yellow")
turtle.begin_fill()
turtle.circle(100)
turtle.end_fill()
# 画鸡腿
turtle.penup()
turtle.goto(-30, )
turtle.pendown()
turtle.color("orange")
turtle.begin_fill()
turtle.forward(60)
turtle.right(90)
turtle.forward(30)
turtle.right(90)
turtle.forward(60)
turtle.right(90)
turtle.forward(30)
turtle.end_fill()
turtle.penup()
turtle.goto(30, )
turtle.pendown()
turtle.color("orange")
turtle.begin_fill()
turtle.forward(60)
turtle.right(90)
turtle.forward(30)
turtle.right(90)
turtle.forward(60)
turtle.right(90)
turtle.forward(30)
turtle.end_fill()
# 完成
turtle.done()
```
希望这个代码可以帮到你!
相关推荐
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)