给你一面国旗 教你用python画中国国旗
作者:默默hong 发布时间:2023-06-25 15:10:36
标签:python,中国国旗,国旗
本文实例为大家分享了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()
来源:https://blog.csdn.net/yuehongqqqq/article/details/81198290


猜你喜欢
- 通常我们提交代码一般都是 git add ,git commit -m, git push的这么个流程。添加到暂存区
- 本文实例为大家分享了python读取Excel实例的具体代码,供大家参考,具体内容如下1.操作步骤:(1)安装python官方Excel库-
- 本文将简单介绍四种获取对象的方法。假如有以下的类:class Person(object): def __init__(self, name
- Display SQL Server Login Mode. Supported Plat
- 如下所示:#获得视频的格式videoCapture = cv2.VideoCapture('/home/lw/3661.mp4
- 安装配置MongoDB驱动安装驱动go get -u github.com/mongodb/mongo-go-driver初始化模块go m
- 本文主要向大家介绍的是正确优化SQL Server数据库的经验总结,其中包括在对其进行优化的实际操作中值得大家注意的地方描述,以及对SQL语
- 问题描述  最近需要给程序新增功能,用于将旧格式的数据转换为新格式,同时删除旧格式的数据(新旧格式的数据
- vue后台返回base64图片无法显示关于后台接口返回的图片base64格式页面无法显示的问题,我遇到的原因是因为返回的一串内容里面存在空格
- folium是python的一个用来绘制地图,并在地图上打点,画圈,做颜色标记的工具类。简单易学,和pandas可以很好的融合,是居家必备良
- 简单替代密码简单替换密码是最常用的密码,包括为每个密文文本字符替换每个纯文本字符的算法.在这个过程中,与凯撒密码算法相比,字母表是混乱的.示
- 1.语法及用法(1)语法:str.endswith(suffix[,start][,end])str:字符串,待判断字符串suffix:后缀
- 一、背景今天有个小需求,要确认客户端有没有往服务端发送udp包,但为了减轻工作量,不想每次到机器上手动执行tcpdump抓包命令。于是就写了
- 数据平台 Kaggle 近日发布了 2017 机器学习及数据科学调查报告,这也是 Kaggle 首次进行全行业调查。调查共收到超过 1600
- Like中文解释为喜欢的意思,但当应用于MySQL数据库中,Like则是一种语句,用于模糊查询,主要是针对字符型字段的,在一个字符型字段列中
- 代码如下: function HandleTabKey(evt) {
- 静态方法不需要所在类被实例化就可以直接使用。静态方法效率上要比实例化高,静态方法的缺点是不自动进行销毁,而实例化的则可以做销毁。静态方法和静
- 相信有很多人有用程序向Excel导数据的需求, 且做过. 一般导出一些文本数据是很方便的, 可选方法很多, 比如拼接文本字符串存.cvs格式
- 临近下班的时候,突然想到统计热门文章的问题。以前我所知道的热门文章统计,基本有这么几种:按点击数排序 该方法最大的问题在于热门的文章会越来越
- 如果出现 automation服务器不能创建对象 解决方法:1、如果是Scripting.FileSystemObje