只用Python turtle画一个简单的光头强头像,颜色要求用简单的颜色
时间: 2023-06-08 17:04:05 浏览: 253
好的,我可以帮您画一个简单的光头强头像,使用Python turtle进行绘制。以下是绘制代码:
```
import turtle
# 设置画笔的颜色和尺寸
turtle.color("brown")
turtle.pensize(3)
# 绘制头部轮廓
turtle.circle(100)
# 绘制眼睛
turtle.penup()
turtle.goto(-50, 50)
turtle.pendown()
turtle.circle(20)
turtle.penup()
turtle.goto(50, 50)
turtle.pendown()
turtle.circle(20)
# 绘制眼珠
turtle.color("white")
turtle.penup()
turtle.goto(-50, 60)
turtle.pendown()
turtle.fillcolor("white")
turtle.begin_fill()
turtle.circle(10)
turtle.end_fill()
turtle.penup()
turtle.goto(50, 60)
turtle.pendown()
turtle.fillcolor("white")
turtle.begin_fill()
turtle.circle(10)
turtle.end_fill()
# 绘制鼻子
turtle.color("brown")
turtle.penup()
turtle.goto(0, 0)
turtle.pendown()
turtle.fillcolor("brown")
turtle.begin_fill()
turtle.circle(10)
turtle.end_fill()
# 绘制嘴巴
turtle.penup()
turtle.goto(-40, -40)
turtle.pendown()
turtle.circle(30, 180)
# 绘制耳朵
turtle.penup()
turtle.goto(-110, 90)
turtle.pendown()
turtle.fillcolor("brown")
turtle.begin_fill()
turtle.circle(30)
turtle.end_fill()
turtle.penup()
turtle.goto(110, 90)
turtle.pendown()
turtle.fillcolor("brown")
turtle.begin_fill()
turtle.circle(30)
turtle.end_fill()
# 完成绘制
turtle.hideturtle()
turtle.done()
```
这段代码使用turtle模块绘制了一个光头强头像,您可以根据自己的需求进行修改。
阅读全文