给你一面国旗 教你用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字符串处理函数简明总结
Apr 13 Python
Python工程师面试题 与Python基础语法相关
Jan 14 Python
Python 两个列表的差集、并集和交集实现代码
Sep 21 Python
Unicode和Python的中文处理
Mar 19 Python
Python基础学习之常见的内建函数整理
Sep 06 Python
详解python 注释、变量、类型
Aug 10 Python
python 2.7 检测一个网页是否能正常访问的方法
Dec 26 Python
浅谈pyqt5中信号与槽的认识
Feb 17 Python
python3实现指定目录下文件sha256及文件大小统计
Feb 25 Python
Python3.7 pyodbc完美配置访问access数据库
Oct 03 Python
Python基础类继承重写实现原理解析
Apr 03 Python
Python读写Excel表格的方法
Mar 02 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
二十行语句实现从Excel到mysql的转化
2006/10/09 PHP
PHP编程过程中需要了解的this,self,parent的区别
2009/12/30 PHP
关于使用runtimeStyle属性问题讨论文章
2007/03/08 Javascript
XMLHTTP 乱码的解决方法(UTF8,GB2312 编码 解码)
2011/01/12 Javascript
使用RequireJS优化JavaScript引用代码的方法
2015/07/01 Javascript
JS+CSS简单树形菜单实现方法
2015/09/12 Javascript
jquery插件bootstrapValidator数据验证详解
2016/11/09 Javascript
js实现点击按钮弹出上传文件的窗口
2016/12/23 Javascript
微信小程序实现点击按钮修改view标签背景颜色功能示例【附demo源码下载】
2017/12/06 Javascript
JavaScript动画实例之粒子文本的实现方法详解
2020/07/28 Javascript
js制作提示框插件
2020/12/24 Javascript
python difflib模块示例讲解
2017/09/13 Python
浅谈django model postgres的json字段编码问题
2018/01/05 Python
python中sys.argv函数精简概括
2018/07/08 Python
django进阶之cookie和session的使用示例
2018/08/17 Python
python实现网站微信登录的示例代码
2019/09/18 Python
Python Numpy数组扩展repeat和tile使用实例解析
2019/12/09 Python
对pytorch的函数中的group参数的作用介绍
2020/02/18 Python
Python数据可视化常用4大绘图库原理详解
2020/10/23 Python
Python根据URL地址下载文件并保存至对应目录的实现
2020/11/15 Python
Python 利用flask搭建一个共享服务器的步骤
2020/12/05 Python
Python入门基础之数字字符串与列表
2021/02/01 Python
韩国演唱会订票网站:StubHub韩国
2019/01/17 全球购物
网络安全方面的面试题
2016/01/07 面试题
给面试官的感谢信
2014/02/01 职场文书
产品推广策划方案
2014/05/10 职场文书
应届生求职信范文
2014/05/26 职场文书
县政府办公室领导班子个人对照检查材料
2014/09/16 职场文书
加强机关作风建设心得体会
2014/10/22 职场文书
遗失说明具结保证书
2015/02/26 职场文书
小学教师岗位职责
2015/04/02 职场文书
2015小学新教师个人工作总结
2015/10/14 职场文书
财务年终工作总结大全
2019/06/20 职场文书
详解PHP服务器如何在有限的资源里最大提升并发能力
2021/05/25 PHP
OpenCV-Python实现油画效果的实例
2021/06/08 Python
vue elementUI表格控制对应列
2022/04/13 Vue.js