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,笑脸,哭脸
0
投稿
猜你喜欢
MySQL安全大讲堂:MySQL数据库安全配置
2009-10-18 11:24:00
JS实现向表格行添加新单元格的方法
2024-02-25 03:09:26
python 贪心算法的实现
2023-01-25 08:18:50
python数据库如何连接SQLite详解
2024-01-22 16:36:04
Mysql视图和触发器使用过程
2024-01-15 22:15:46
Keras 使用 Lambda层详解
2021-08-11 20:12:40
js模仿php中strtotime()与date()函数实现方法
2024-04-18 10:01:55
python实现扫雷小游戏
2023-02-15 11:58:58
MySQL与Oracle的语法区别详细对比
2024-01-20 12:24:47
golang中json反序列化可能遇到的问题
2024-04-27 15:36:12
python PyGame五子棋小游戏
2023-09-29 13:32:45
快速图片链接批处理
2007-02-03 11:39:00
Python性能优化技巧
2021-06-29 12:48:32
Python打印scrapy蜘蛛抓取树结构的方法
2022-01-16 03:46:18
PHP二维码的生成与识别案例
2023-06-14 06:48:55
vue实际运用之vuex持久化详解
2024-05-09 15:15:50
HTML5本地存储初探(一)
2010-03-07 15:42:00
Scrapy框架基本命令与settings.py设置
2021-12-03 14:05:47
python根据京东商品url获取产品价格
2022-01-26 12:14:31
使用 Python 快速实现 HTTP 和 FTP 服务器的方法
2023-01-14 16:36:04