python画叮当猫代码
时间: 2023-11-12 09:59:58 浏览: 51
好的,以下是Python画叮当猫的代码:
```python
import turtle
# 设置画笔
t = turtle.Pen()
t.speed(0)
t.pensize(5)
# 画身体
t.fillcolor('white')
t.begin_fill()
t.circle(100)
t.end_fill()
# 画头部
t.fillcolor('black')
t.begin_fill()
t.circle(50)
t.end_fill()
# 画眼睛
t.penup()
t.goto(-30, 120)
t.pendown()
t.fillcolor('white')
t.begin_fill()
t.circle(20)
t.end_fill()
t.penup()
t.goto(-30, 130)
t.pendown()
t.fillcolor('black')
t.begin_fill()
t.circle(10)
t.end_fill()
t.penup()
t.goto(30, 120)
t.pendown()
t.fillcolor('white')
t.begin_fill()
t.circle(20)
t.end_fill()
t.penup()
t.goto(30, 130)
t.pendown()
t.fillcolor('black')
t.begin_fill()
t.circle(10)
t.end_fill()
# 画鼻子
t.penup()
t.goto(0, 100)
t.pendown()
t.fillcolor('red')
t.begin_fill()
t.circle(10)
t.end_fill()
# 画胡须
t.penup()
t.goto(-40, 80)
t.pendown()
t.goto(-100, 80)
t.penup()
t.goto(-40, 70)
t.pendown()
t.goto(-100, 60)
t.penup()
t.goto(-40, 60)
t.pendown()
t.goto(-100, 40)
t.penup()
t.goto(40, 80)
t.pendown()
t.goto(100, 80)
t.penup()
t.goto(40, 70)
t.pendown()
t.goto(100, 60)
t.penup()
t.goto(40, 60)
t.pendown()
t.goto(100, 40)
# 完成
turtle.done()
```
相关推荐
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.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)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)