位置:郑州小码王少儿编程 > 学校动态 > Python少儿编程教育--表情包制作
Python少儿编程教育--表情包制作
来源:郑州小码王少儿编程时间:2023/4/16 10:27:15
Python少儿编程教育--表情包制作
1、课程目标
学习画圆指令,掌握海龟绘图的移动位置
绘制有趣表情包
2、所需知识
turtle.circle(半径,角度):根据半径radius绘制extent角度的弧形,默认画360°的圆turtle.showturtle():显示画笔turtle.hideturtle():隐藏画笔
3、任务
绘制呆萌表情包
图片
代码:
#==========左眼
#大圆
#设置填充颜色
turtle.fillcolor('yellow')
#开始填充
turtle.begin_fill()
turtle.circle(100)
#结束填充
turtle.end_fill()
#中圆
turtle.penup()
turtle.goto(-30,100)
turtle.pendown()
turtle.fillcolor('white')
turtle.begin_fill()
turtle.circle(20)
turtle.end_fill()
#小圆
turtle.fillcolor('black')
turtle.begin_fill()
turtle.circle(10)
turtle.end_fill()
#==========右眼
turtle.penup()
turtle.goto(30,100)
turtle.pendown()
turtle.fillcolor('white')
turtle.begin_fill()
turtle.circle(20)
turtle.end_fill()
#小圆
turtle.fillcolor('black')
turtle.begin_fill()
turtle.circle(10)
turtle.end_fill()
turtle.hideturtle()
#==========嘴巴
turtle.penup()
turtle.goto(0,30)
turtle.pendown()
turtle.fillcolor('white')
turtle.begin_fill()
turtle.circle(10)
turtle.end_fill()
尊重原创文章,转载请注明出处与链接:http://www.peixun360.com/8402/news/613436/违者必究!
以上就是郑州小码王少儿编程 小编为您整理 Python少儿编程教育--表情包制作的全部内容。