给你一面国旗 教你用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的Flask框架中实现简单的登录功能的教程
Apr 20 Python
Python合并多个装饰器小技巧
Apr 28 Python
简单介绍Python中的floor()方法
May 15 Python
开始着手第一个Django项目
Jul 15 Python
Python内建数据结构详解
Feb 03 Python
Python实现定期检查源目录与备份目录的差异并进行备份功能示例
Feb 27 Python
详解python执行shell脚本创建用户及相关操作
Apr 11 Python
sklearn-SVC实现与类参数详解
Dec 10 Python
Tensorflow 定义变量,函数,数值计算等名字的更新方式
Feb 10 Python
Python sklearn库实现PCA教程(以鸢尾花分类为例)
Feb 24 Python
JAVA及PYTHON质数计算代码对比解析
Jun 10 Python
分享PyCharm最新激活码(真永久激活方法)不用每月找安装参数或最新激活码了
Dec 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
php session 检测和注销
2009/03/16 PHP
PHP中通过加号合并数组的一个简单方法分享
2011/01/27 PHP
PHP利用str_replace防注入的方法
2013/11/10 PHP
简单理解PHP的面向对象编程方式
2016/05/17 PHP
thinkphp项目如何自定义微信分享描述内容
2017/02/20 PHP
php中isset与empty函数的困惑与用法分析
2019/07/05 PHP
jQuery EasyUI API 中文文档 - Menu菜单
2011/10/03 Javascript
JavaScript 反科里化 this [译]
2012/09/20 Javascript
JS动态添加Table的TR,TD实现方法
2015/01/28 Javascript
JavaScript控制listbox列表框的项目上下移动的方法
2015/03/18 Javascript
JavaScript实现Iterator模式实例分析
2015/06/09 Javascript
window.onload使用指南
2015/09/13 Javascript
JavaScript常用基础知识强化学习
2015/12/09 Javascript
Highcharts使用简例及异步动态读取数据
2015/12/30 Javascript
使用JS在浏览器中判断当前网络连接状态的几种方法
2017/05/05 Javascript
JS 中LocalStorage和SessionStorage的使用
2017/08/17 Javascript
使用 Github Actions 自动部署 Angular 应用到 Github Pages的方法
2020/07/20 Javascript
vue实现公共方法抽离
2020/07/31 Javascript
Python解析最简单的验证码
2016/01/07 Python
python实现SMTP邮件发送功能
2020/06/16 Python
Python开发的实用计算器完整实例
2017/05/10 Python
Python决策树分类算法学习
2017/12/22 Python
python线程的几种创建方式详解
2019/08/29 Python
Django如何使用redis作为缓存
2020/05/21 Python
python3中calendar返回某一时间点实例讲解
2020/11/18 Python
Pytorch1.5.1版本安装的方法步骤
2020/12/31 Python
matplotlib绘制正余弦曲线图的实现
2021/02/22 Python
Sneaker Studio匈牙利:购买运动鞋
2018/03/26 全球购物
应届生人事助理求职信
2013/11/09 职场文书
集团公司党的群众路线教育实践活动工作总结
2014/03/03 职场文书
护士长2014年度工作总结
2014/11/11 职场文书
2015年敬老月活动总结
2015/03/27 职场文书
运动会入场词
2015/07/18 职场文书
新学期家长寄语2016
2015/12/03 职场文书
如何正确理解python装饰器
2021/06/15 Python
Spring Boot项目传参校验的最佳实践指南
2022/04/05 Java/Android