给你一面国旗 教你用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
0
投稿
猜你喜欢
- 为了实现将RAW格式照片一键改变整体风格,且有多种风格选择,我们可以使用神经风格迁移技术。神经风格迁移是一种基于深度学习的方法,可以将一张图
- 在中文网页中最常见的网页编码就是GB2312和UTF-8了,本文介绍了ASP实现GB2312编码转换为UTF-8编码的函数:Function
- progress库安装和介绍1.安装progress库progress是Python第三方库,在终端执行 pip 命令安装。pip inst
- 本文实例讲述了python实现自动登录人人网并采集信息的方法。分享给大家供大家参考。具体实现方法如下:#!/usr/bin/python#
- 我想大多数的人在编写ASP程序的时候,都碰到过类似的错误信息: Error Num
- 问:怎样才能指定MySQL只监听某个特定地址?答:比较常见的办法是,在my.cnf之mysqld节,添加bind-address=127.0
- pytorch里面的maxpool,有一个属性叫ceil_mode,这个属性在api里面的解释是ceil_mode: when True,
- matplotlib窗口图标默认是matplotlib的标志,如果想修改怎么改呢?由于我选择的matplotlib后端是PyQT5,直接查看
- python具体强大的库文件,很多功能都有相应的库文件,所以很有必要进行学习一下,其中有一个ftp相应的库文件ftplib,我们只需要其中的
- 简介本文主要简述如何通过sklearn模块来进行预测和学习,最后再以图表这种更加直观的方式展现出来数据集学习数据预测数据数据处理数据分离因为
- 在Python中是没有Switch / Case语句的,很多人认为这种语句不够优雅灵活,在Python中用字典来处理多条件匹配问题字典会更简
- 本文实例讲述了Python基于递归算法实现的汉诺塔与Fibonacci数列。分享给大家供大家参考,具体如下:这里我们通过2个例子,学习pyt
- pypdf2是一个Python模块,可以用来读取、写入和操作PDF文件。要安装pypdf2模块,请按照以下步骤操作:确保你已经安装了Pyth
- if xxx 和if xxx is None的区别一、 if xxxNone,’’,0,[],{},
- 说起来惭愧,总是犯一些小错误,纠结半天,这不应为一个分号的玩意折腾了好半天! 错误时在执行SQL语句的时候发出的,信息如下: Java代码
- 作为一个非设计出生的研究思路偏向的设计师,带着少了设计师自恋和自怜的眼光,我记下最近一年来感受到的交互设计师的尴尬。交互设计师就是出界面的,
- floor() 函数向下舍入为最接近的整数。语法floor(x)参数描述x必需。一个数。说明返回不大于 x 的下一个整数
- RegExp就是建立正则的对像。如:Set regEx = New RegExp regE
- <!-- #include file="conn.asp" -->
- requestRequests 是使用 Apache2 Licensed 许可证的 基于Python开发的HTTP 库,其在Python内置