python画草莓熊源代码
时间: 2023-11-07 18:03:48 浏览: 967
草莓熊的Python绘图源代码如下:
```python
import turtle
# 设置画布大小和颜色
turtle.setup(800, 600)
turtle.bgcolor("pink")
# 绘制草莓
turtle.pensize(3)
turtle.color("red")
turtle.begin_fill()
turtle.circle(100)
turtle.end_fill()
# 绘制眼睛
turtle.penup()
turtle.goto(-30, 60)
turtle.pendown()
turtle.color("white")
turtle.begin_fill()
turtle.circle(20)
turtle.end_fill()
turtle.penup()
turtle.goto(30, 60)
turtle.pendown()
turtle.begin_fill()
turtle.circle(20)
turtle.end_fill()
# 绘制嘴巴
turtle.penup()
turtle.goto(-40, 20)
turtle.pendown()
turtle.color("red")
turtle.left(60)
turtle.circle(40, 120)
turtle.left(180)
turtle.circle(40, 120)
# 绘制脚
turtle.penup()
turtle.goto(-70, -100)
turtle.pendown()
turtle.color("green")
turtle.begin_fill()
turtle.circle(20)
turtle.end_fill()
turtle.penup()
turtle.goto(70, -100)
turtle.pendown()
turtle.begin_fill()
turtle.circle(20)
turtle.end_fill()
# 绘制尾巴
turtle.penup()
turtle.goto(0, -180)
turtle.pendown()
turtle.color("red")
turtle.left(60)
turtle.circle(80, 120)
turtle.left(180)
turtle.circle(80, 120)
turtle.done()
```
阅读全文