這篇文章主要介紹了如何使用python畫中國國旗,具有一定借鑒價值,感興趣的朋友可以參考下,希望大家閱讀完這篇文章之后大有收獲,下面讓小編帶著大家一起了解一下。
Python主要應用于:1、Web開發(fā);2、數(shù)據(jù)科學研究;3、網(wǎng)絡爬蟲;4、嵌入式應用開發(fā);5、游戲開發(fā);6、桌面應用開發(fā)。
分享了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()
感謝你能夠認真閱讀完這篇文章,希望小編分享的“如何使用python畫中國國旗”這篇文章對大家有幫助,同時也希望大家多多支持創(chuàng)新互聯(lián),關注創(chuàng)新互聯(lián)行業(yè)資訊頻道,更多相關知識等著你來學習!
當前標題:如何使用python畫中國國旗-創(chuàng)新互聯(lián)
文章路徑:http://chinadenli.net/article10/dgdcdo.html
成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站改版、用戶體驗、商城網(wǎng)站、軟件開發(fā)、動態(tài)網(wǎng)站、Google
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容