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畫個五星紅旗
根據下圖發現,主星和2 3副星從右畫就好,而1 4副星從左開始畫會比較好找座標。turtle.speed 10 主星 turtle.begin fill turtle.up turtle.goto 600,220 turtle.down for i in range 5 turtle.forward...
python 繪製五星紅旗
1 匯入繪圖包 2import turtle3 自定義繪製圖形位置函式 4def mygoto x,y 5turtle.up 6turtle.goto x,y 7turtle.down 8 自定義繪製五角星函式 9def drow x 10turtle.begin fill 11for i in r...
豆瓣評分,迷失在「一星」和「五星」裡
豆瓣評分又雙叒叕陷入了爭議中。原定12月1日20時上線的 風起洛陽 因技術原因延遲一小時上線,但一星黑評和五星好評先一步湧入豆瓣www.cppcns.com。12月5日 誰是 上線兩集,女主角趙麗穎尚未出場,豆瓣短評中 女主角演技差 台詞拉胯 言論比比皆是。當天晚上,趙麗穎粉絲在微博上亮出了分析截圖...