用python绘制一个热气球
时间: 2024-05-27 07:13:48 浏览: 10
```python
import turtle
# 设置画布大小和背景颜色
turtle.setup(800, 600)
turtle.bgcolor('#87CEFA')
# 画热气球篮子
turtle.penup()
turtle.goto(-100, -200)
turtle.pendown()
turtle.fillcolor('#F0E68C')
turtle.begin_fill()
turtle.circle(50)
turtle.end_fill()
# 画热气球外壳
turtle.penup()
turtle.goto(-100, -150)
turtle.pendown()
turtle.fillcolor('#FF6347')
turtle.begin_fill()
turtle.circle(100)
turtle.end_fill()
# 画热气球绳子
turtle.penup()
turtle.goto(-100, 0)
turtle.pendown()
turtle.pensize(5)
turtle.color('#8B4513')
turtle.goto(-100, 50)
# 画热气球顶部
turtle.penup()
turtle.goto(-100, 100)
turtle.pendown()
turtle.fillcolor('#FFFF00')
turtle.begin_fill()
turtle.circle(50)
turtle.end_fill()
# 写上热气球的口号
turtle.penup()
turtle.goto(0, -250)
turtle.pendown()
turtle.color('#8B0000')
turtle.write('Fly High!', font=('Arial', 30, 'bold'))
# 隐藏画笔
turtle.hideturtle()
# 显示绘图窗口
turtle.done()
```
![热气球](https://cdn.luogu.com.cn/upload/image_hosting/mn1u05k6.png)
相关推荐
![3dl](https://img-home.csdnimg.cn/images/20210720083646.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)