绘制可爱的笑脸
功能要求
使用海龟绘图画可爱的笑脸
说明:笑脸主要由三个圆形和一个弧线组成。笑脸的脸为黄色的圆形,眼睛为两个黑色圆形,嘴为黑色的弧线。
实例代码
import turtle
t = turtle.Pen()
t.hideturtle()
#画脸
t.color('red','yellow')
t.begin_fill()
t.circle(50)
t.end_fill()
#移动画笔
t.penup()
t.goto(-20, 50)
t.pendown()
#画左眼
t.color('yellow', 'black')
t.begin_fill()
t.circle(10)
t.end_fill()
#移动画笔
t.penup()
t.goto(20, 50)
t.pendown()
#画右眼
t.color('yellow', 'black')
t.begin_fill()
t.circle(10)
t.end_fill()
#移动画笔
t.penu