请用Python画一个总线加一只猫。
时间: 2023-05-24 17:01:17 浏览: 91
1wire-DS18B20-python-mysql.zip_1wire_Write On_python ds18b20_ras
当然可以,下面是Python代码:
```
import turtle
# 画总线
turtle.penup()
turtle.goto(-100, 0)
turtle.pendown()
turtle.goto(100, 0)
# 画猫
turtle.penup()
turtle.goto(0, 50)
turtle.pendown()
turtle.circle(50)
turtle.penup()
turtle.goto(-20, 60)
turtle.pendown()
turtle.begin_fill()
turtle.circle(10)
turtle.end_fill()
turtle.penup()
turtle.goto(20, 60)
turtle.pendown()
turtle.begin_fill()
turtle.circle(10)
turtle.end_fill()
turtle.penup()
turtle.goto(0, 40)
turtle.pendown()
turtle.right(90)
turtle.circle(-30, 180)
turtle.done()
```
希望你能从这个代码中获得一些启示,谢谢!
阅读全文