给你一面国旗 教你用python画中国国旗
2019-09-24 14:08
2386 查看
本文实例为大家分享了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中用turtle来画中国国旗
- jsp实现生成中国国旗图片效果代码
- python/folium绘制中国人口数量热力图(HeatMap)
- python利用K均值做聚类,判断中国足球第几流
- Python爬取中国票房网所有电影片名和演员名字,爬取齐鲁网大陆所有电视剧名称
- 随想录(用python预测未来中国的GDP)
- PyConChina 2012 - 第二届中国Python开发者大会 上海.北京.西安.杭州.合肥.武汉.珠海 | 抢座网
- Python---turtle模块---美国国旗的绘画
- Python 爬取 B 站数据分析,宋智孝李光洙谁最受中国粉丝喜爱
- 中国剩余定理 Python实现
- Python 的加密库入门 | Linux 中国
- 利用 Python 引导孩子的计算机思维 | Linux 中国
- python入门爬虫 60行代码抓取amazon中国站
- 使用 Python 的 urlliib.parse 库解析 URL | Linux 中国
- Pelican 入门:一个 Python 静态网站生成器 | Linux 中国
- Python实现的中国剩余定理算法示例
- Python3.4 邮件(包含附件与中国)
- Python cartopy 使用地图工具,给出经纬度,画出受影响的中国省份
- python利用K均值做聚类,判断中国足球第几流
- 中国有句俗语叫“三天打鱼两天晒网”。某人从2010年1月1日起开始“三天打鱼两天晒网”,问这个人在以后的某一天中是“打鱼”还是“晒网”。用C或C++语言/java/python实现程序解决问题。