给你一面国旗 教你用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实现监控windows服务并自动启动服务示例
Apr 17 Python
python网络编程学习笔记(五):socket的一些补充
Jun 09 Python
Python实现截屏的函数
Jul 25 Python
Python的爬虫框架scrapy用21行代码写一个爬虫
Apr 24 Python
批量将ppt转换为pdf的Python代码 只要27行!
Feb 26 Python
Win10下Python3.7.3安装教程图解
Jul 08 Python
django 实现celery动态设置周期任务执行时间
Nov 19 Python
tensorflow通过模型文件,使用tensorboard查看其模型图Graph方式
Jan 23 Python
浅谈cv2.imread()和keras.preprocessing中的image.load_img()区别
Jun 12 Python
浅谈Keras中shuffle和validation_split的顺序
Jun 19 Python
python如何建立全零数组
Jul 19 Python
Python实现上下文管理器的方法
Aug 07 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
解析php dirname()与__FILE__常量的应用
2013/06/24 PHP
使用PHP实现阻止用户上传成人照片或者裸照
2014/12/25 PHP
smarty模板引擎从php中获取数据的方法
2015/01/22 PHP
Linux系统中为php添加pcntl扩展
2016/08/28 PHP
php实现保存周期为1天的购物车类
2017/07/07 PHP
JavaScript对象之间的转换 jQuery对象和原声DOM
2011/03/07 Javascript
jQuery 对Select的操作备忘记录
2011/07/04 Javascript
js弹出框轻量级插件jquery.boxy使用介绍
2013/01/15 Javascript
JavaScript sub方法入门实例(把字符串显示为下标)
2014/10/17 Javascript
javascript实现checkbox全选的代码
2015/04/30 Javascript
jQuery+Ajax实现无刷新操作
2016/01/04 Javascript
解决Vue编译时写在style中的路径问题
2017/09/21 Javascript
使用JS中的Replace()方法遇到的问题小结
2017/10/20 Javascript
使用vue根据状态添加列表数据和删除列表数据的实例
2018/09/29 Javascript
vue实现日历备忘录功能
2020/09/24 Javascript
vue+Element中table表格实现可编辑(select下拉框)
2020/05/21 Javascript
JS中队列和双端队列实现及应用详解
2020/09/29 Javascript
[54:43]DOTA2-DPC中国联赛 正赛 CDEC vs Dynasty BO3 第一场 2月22日
2021/03/11 DOTA
浅析python中SQLAlchemy排序的一个坑
2017/02/24 Python
Python实现将数据写入netCDF4中的方法示例
2018/08/30 Python
Django对数据库进行添加与更新的例子
2019/07/12 Python
pytorch AvgPool2d函数使用详解
2020/01/03 Python
python json load json 数据后出现乱序的解决方案
2020/02/27 Python
Python通过Tesseract库实现文字识别
2020/03/05 Python
Python学习笔记之装饰器
2020/08/06 Python
荷兰包包购物网站:The Little Green Bag
2018/03/17 全球购物
法国最大的在线眼镜店:EasyLunettes
2019/08/26 全球购物
婚鞋、新娘鞋、礼服鞋、童鞋:Nina Shoes
2019/09/04 全球购物
社团2014年植树节活动总结
2014/03/11 职场文书
高中学生期末评语
2014/04/25 职场文书
大学生党员批评与自我批评
2014/09/28 职场文书
大学生旷课检讨书1000字
2015/02/19 职场文书
火烧圆明园的观后感
2015/06/03 职场文书
简历自我评价范文
2019/04/24 职场文书
redis通过6379端口无法连接服务器(redis-server.exe闪退)
2021/05/08 Redis
mysql5.7的安装及Navicate长久免费使用的实现过程
2021/11/17 MySQL