turtle画一个复杂人物
时间: 2023-11-04 08:18:36 浏览: 27
好的,让我来画一个复杂的人物。以下是Python代码:
```python
import turtle
# 设置画笔
t = turtle.Turtle()
t.speed(0)
# 绘制头部
t.penup()
t.goto(0, 100)
t.pendown()
t.begin_fill()
t.circle(70)
t.end_fill()
# 绘制左眼
t.penup()
t.goto(-40, 140)
t.pendown()
t.begin_fill()
t.circle(10)
t.end_fill()
# 绘制右眼
t.penup()
t.goto(40, 140)
t.pendown()
t.begin_fill()
t.circle(10)
t.end_fill()
# 绘制嘴巴
t.penup()
t.goto(-30, 90)
t.pendown()
t.right(90)
t.circle(30, 180)
# 绘制身体
t.penup()
t.goto(0, 0)
t.pendown()
t.begin_fill()
t.circle(100)
t.end_fill()
# 绘制左臂
t.penup()
t.goto(-100, 0)
t.pendown()
t.begin_fill()
t.forward(80)
t.left(90)
t.forward(20)
t.left(90)
t.forward(80)
t.end_fill()
# 绘制右臂
t.penup()
t.goto(100, 0)
t.pendown()
t.begin_fill()
t.forward(80)
t.right(90)
t.forward(20)
t.right(90)
t.forward(80)
t.end_fill()
# 绘制左腿
t.penup()
t.goto(-50, -100)
t.pendown()
t.begin_fill()
t.right(90)
t.forward(80)
t.left(90)
t.forward(20)
t.left(90)
t.forward(80)
t.end_fill()
# 绘制右腿
t.penup()
t.goto(50, -100)
t.pendown()
t.begin_fill()
t.right(90)
t.forward(80)
t.right(90)
t.forward(20)
t.right(90)
t.forward(80)
t.end_fill()
# 隐藏画笔
t.hideturtle()
# 程序结束
turtle.done()
```
执行以上代码,你将看到一个复杂的人物被turtle绘制出来。