給你一面國旗 教你用python畫中國國旗
更新時間:2019年09月24日 14:08:55 作者:默默hong
朋友圈許多小伙伴都在發(fā):請給我一面五星紅旗的動態(tài),這篇文章就主要教大家如何使用python畫中國國旗,具有一定的參考價值,感興趣的小伙伴們可以參考一下
本文實(shí)例為大家分享了python畫中國國旗的具體代碼,供大家參考,具體內(nèi)容如下
# 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()

以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
相關(guān)文章
pyhton中__pycache__文件夾的產(chǎn)生與作用詳解
這篇文章主要介紹了pyhton中__pycache__文件夾的產(chǎn)生與作用詳解,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2019-11-11
python pandas讀取csv后,獲取列標(biāo)簽的方法
今天小編就為大家分享一篇python pandas讀取csv后,獲取列標(biāo)簽的方法,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧2018-11-11
卷積神經(jīng)網(wǎng)絡(luò)的發(fā)展及各模型的優(yōu)缺點(diǎn)及說明
這篇文章主要介紹了卷積神經(jīng)網(wǎng)絡(luò)的發(fā)展及各模型的優(yōu)缺點(diǎn)及說明,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教2023-02-02
利用python在excel中畫圖的實(shí)現(xiàn)方法
這篇文章主要介紹了利用python在excel中畫圖的實(shí)現(xiàn)方法,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2020-03-03
淺析Python如何實(shí)現(xiàn)Celery任務(wù)隊(duì)列系統(tǒng)
這篇文章主要為大家詳細(xì)介紹了一個基于 Celery 和 Redis 的分布式任務(wù)隊(duì)列系統(tǒng),用于處理異步任務(wù)和定時任務(wù),希望對大家有一定的幫助2025-04-04

