python 利用turtle库绘制笑脸和哭脸的例子
作者:yiweiyi329 时间:2022-01-16 08:35:30
我就废话不多说了,直接上代码吧!
import turtle
turtle.pensize(5)
turtle.pencolor("yellow")
turtle.fillcolor("red")
turtle.penup()
turtle.goto(0,-200)
turtle.pendown()
turtle.circle(200)
turtle.penup()
turtle.goto(-100,50)
turtle.pendown()
turtle.begin_fill()
turtle.circle(17.5)
turtle.end_fill()
turtle.penup()
turtle.goto(100,50)
turtle.pendown()
turtle.begin_fill()
turtle.circle(17.5)
turtle.end_fill()
turtle.penup()
turtle.goto(0,50)
turtle.pendown()
turtle.circle(-70,steps=3)
turtle.penup()
turtle.goto(-100,-70)
turtle.pendown()
turtle.right(90)
turtle.circle(100,180)
turtle.mainloop()#结果如下
import turtle
turtle.pensize(5)
turtle.pencolor("green")
turtle.fillcolor("red")
turtle.penup()
turtle.goto(0,-200)
turtle.pendown()
turtle.circle(200)
turtle.penup()
turtle.goto(-100,50)
turtle.pendown()
turtle.begin_fill()
turtle.circle(17.5)
turtle.end_fill()
turtle.penup()
turtle.goto(100,50)
turtle.pendown()
turtle.begin_fill()
turtle.circle(17.5)
turtle.end_fill()
turtle.penup()
turtle.goto(0,50)
turtle.pendown()
turtle.circle(-70,steps=3)
turtle.penup()
turtle.goto(-50,-120)
turtle.pendown()
turtle.left(90)
turtle.circle(-50,180)
turtle.mainloop()#结果如下
import turtle
turtle.pensize(5)
turtle.pencolor("green")
turtle.fillcolor("red")
turtle.penup()
turtle.goto(0,-200)
turtle.pendown()
turtle.circle(200)
turtle.penup()
turtle.goto(-100,50)
turtle.pendown()
turtle.begin_fill()
turtle.circle(17.5)
turtle.end_fill()
turtle.penup()
turtle.goto(100,50)
turtle.pendown()
turtle.begin_fill()
turtle.circle(17.5)
turtle.end_fill()
turtle.penup()
turtle.goto(0,50)
turtle.pendown()
turtle.circle(-70,steps=3)
turtle.penup()
turtle.goto(-100,-120)
turtle.pendown()
turtle.left(90)
turtle.circle(-25,180)
turtle.left(180)
turtle.circle(-25,180)
turtle.left(180)
turtle.circle(-25,180)
turtle.left(180)
turtle.circle(-25,180)
turtle.mainloop()#结果如下
来源:https://blog.csdn.net/yiweiyi329/article/details/80267679
标签:python,turtle,笑脸,哭脸
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
浏览器是怎样工作的二:渲染引擎 HTML解析
2012-05-09 20:34:20
python数据类型之间怎么转换技巧分享
2023-09-04 02:38:42
![](https://img.aspxhome.com/file/2023/0/65040_0s.png)
php统计数组不同元素的个数的实例方法
2023-06-11 23:04:59
解决Server对象 错误 'ASP 0178 : 80070005'
2008-02-29 13:45:00
ASP给长的标题加省略号...
2008-02-22 14:39:00
对python中return与yield的区别详解
2022-10-19 00:47:33
python本地文件服务器实例教程
2022-07-31 16:38:17
![](https://img.aspxhome.com/file/2023/7/64607_0s.jpg)
ASP中类的详细介绍(class Property Get、Property Let)
2008-02-20 19:18:00
对用户进行电话访谈的一点感想
2009-12-28 13:05:00
![](https://img.aspxhome.com/file/UploadPic/20101/11/2009-11-25_01-10s.png)
如何利用python正确地为图像添加高斯噪声
2023-08-03 08:26:22
![](https://img.aspxhome.com/file/2023/9/59459_0s.png)
python判断字符串是否纯数字的方法
2022-09-09 03:25:38
asp使用Application来统计在线人数方法
2007-08-13 12:43:00
JSONObject.toString
2008-03-09 19:12:00
给年青设计师们的十条经验教训
2011-03-31 17:09:00
python用tkinter开发的扫雷游戏
2022-05-16 18:39:40
![](https://img.aspxhome.com/file/2023/8/84978_0s.png)
Python astype(np.float)函数使用方法解析
2021-02-23 17:28:16
![](https://img.aspxhome.com/file/2023/5/83905_0s.png)
详解Python3序列赋值、序列解包
2022-04-19 05:24:51
SQL Server 置疑、可疑、正在恢复等情况分析
2012-01-05 18:51:59
javascript操作ASP.NET服务器控件
2023-07-21 15:09:26
Javascript特效--划过放大的列表
2008-03-21 12:18:00
![](https://img.aspxhome.com/file/UploadPic/20083/21/2008321122917663s.jpg)