给你一面国旗 教你用python画中国国旗


Posted in Python onSeptember 24, 2019

本文实例为大家分享了python画中国国旗的具体代码,供大家参考,具体内容如下

# author : momo
import turtle
#中国国旗
turtle.up()
turtle.goto(-200,200)
turtle.down()
turtle.begin_fill()
turtle.fillcolor("red")
turtle.pencolor("red")
for i in range(2):
 turtle.forward(280)
 turtle.right(90)
 turtle.forward(200)
 turtle.right(90)
turtle.end_fill()
 
turtle.up()
turtle.goto(-170,145)
turtle.down()
turtle.begin_fill()
turtle.fillcolor("yellow")
turtle.pencolor("yellow")
for x in range(5):
 turtle.forward(50)
 turtle.right(144)
turtle.end_fill()
 
turtle.up()
turtle.goto(-100,180)
turtle.down()
turtle.begin_fill()
turtle.fillcolor("yellow")
turtle.pencolor("yellow")
for x in range(5):
 turtle.forward(20)
 turtle.right(144)
turtle.end_fill()
 
turtle.up()
turtle.goto(-70,160)
turtle.down()
turtle.begin_fill()
turtle.fillcolor("yellow")
turtle.pencolor("yellow")
for x in range(5):
 turtle.forward(20)
 turtle.right(144)
turtle.end_fill()
 
turtle.up()
turtle.goto(-70,120)
turtle.down()
turtle.begin_fill()
turtle.fillcolor("yellow")
turtle.pencolor("yellow")
for x in range(5):
 turtle.forward(20)
 turtle.right(144)
turtle.end_fill()
 
turtle.up()
turtle.goto(-100,100)
turtle.down()
turtle.begin_fill()
turtle.fillcolor("yellow")
turtle.pencolor("yellow")
for x in range(5):
 turtle.forward(20)
 turtle.right(144)
turtle.end_fill()
 
 
turtle.hideturtle()#隐藏小海龟
#维持面板
turtle.done()

给你一面国旗 教你用python画中国国旗

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持三水点靠木。

Python 相关文章推荐
Python字符串切片操作知识详解
Mar 28 Python
Python编程实现的图片识别功能示例
Aug 03 Python
Python决策树分类算法学习
Dec 22 Python
linux环境下Django的安装配置详解
Jul 22 Python
python集合的创建、添加及删除操作示例
Oct 08 Python
python动态文本进度条的实例代码
Jan 22 Python
浅谈ROC曲线的最佳阈值如何选取
Feb 28 Python
Python 解决火狐浏览器不弹出下载框直接下载的问题
Mar 09 Python
在django admin详情表单显示中添加自定义控件的实现
Mar 11 Python
构建高效的python requests长连接池详解
May 02 Python
Python 实现RSA加解密文本文件
Dec 30 Python
python+selenium爬取微博热搜存入Mysql的实现方法
Jan 27 Python
Python MongoDB 插入数据时已存在则不执行,不存在则插入的解决方法
Sep 24 #Python
Python获取时间戳代码实例
Sep 24 #Python
Python django框架输入汉字,数字,字符生成二维码实现详解
Sep 24 #Python
分享一个pycharm专业版安装的永久使用方法
Sep 24 #Python
python实现的config文件读写功能示例
Sep 24 #Python
python使用socket实现的传输demo示例【基于TCP协议】
Sep 24 #Python
pymysql 开启调试模式的实现
Sep 24 #Python
You might like
Sorting Array Values in PHP(数组排序)
2011/09/15 PHP
destoon首页调用求购供应信息的地区名称的方法
2014/08/21 PHP
PHP邮件发送类PHPMailer用法实例详解
2014/09/22 PHP
Javascript 文件夹选择框的两种解决方案
2009/07/01 Javascript
jQuery中filter()和find()的区别深入了解
2013/09/25 Javascript
用JavaScript实现类似于ListBox功能示例代码
2014/03/09 Javascript
Javascript基础教程之数据类型 (字符串 String)
2015/01/18 Javascript
使用AngularJS 应用访问 Android 手机的图片库
2015/03/24 Javascript
jQuery选择器源码解读(七):elementMatcher函数
2015/03/31 Javascript
javascript中闭包(Closure)详解
2016/01/06 Javascript
JS实现的简易拖放效果示例
2016/12/29 Javascript
JQueryEasyUI框架下的combobox的取值和绑定的方法
2017/01/22 Javascript
使用AngularJS编写多选按钮选中时触发指定方法的指令代码详解
2017/07/24 Javascript
JS+WCF实现进度条实时监测数据加载量的方法详解
2017/12/19 Javascript
python实现bitmap数据结构详解
2014/02/17 Python
通过Python使用saltstack生成服务器资产清单
2016/03/01 Python
Python的Django框架中使用SQLAlchemy操作数据库的教程
2016/06/02 Python
小白如何入门Python? 制作一个网站为例
2018/03/06 Python
对python的unittest架构公共参数token提取方法详解
2018/12/17 Python
pandas DataFrame 警告(SettingWithCopyWarning)的解决
2019/07/23 Python
Python Pandas数据中对时间的操作
2019/07/30 Python
python2和python3实现在图片上加汉字的方法
2019/08/22 Python
python 如何将数据写入本地txt文本文件的实现方法
2019/09/11 Python
python的dict判断key是否存在的方法
2020/12/09 Python
jupyter 添加不同内核的操作
2021/02/06 Python
HTML5 canvas 基本语法
2009/08/26 HTML / CSS
Booking.com英国官网:全球酒店在线预订网站
2018/04/21 全球购物
瑞典手机壳品牌:Richmond & Finch
2018/04/28 全球购物
我的五年职业生涯规划
2014/01/23 职场文书
企业文化标语口号
2014/06/09 职场文书
2015年酒店客房部工作总结
2015/04/25 职场文书
幼儿园毕业典礼家长致辞
2015/07/29 职场文书
《学会生存》读后感3篇
2019/12/09 职场文书
nginx对http请求处理的各个阶段详析
2021/03/31 Servers
css3实现的加载动画效果
2021/04/07 HTML / CSS
Nginx利用Logrotate实现日志分割
2022/05/20 Servers