畫國旗(尺寸不標準)
阿新 • • 發佈:2020-10-09
畫圖 ---
# coding=utf-8
import turtle
import time
# 同時設定pencolor=color1, fillcolor=color2
turtle.color("red", "yellow")
turtle.begin_fill()
for _ in range(50):
turtle.forward(200)
turtle.left(170)
turtle.end_fill()
turtle.mainloop()
'''
import turtle
import time
turtle.color("black","red")
turtle.begin_fill()
for _ in range(2):
turtle.forward(288)
turtle.right(90)
turtle.forward(192)
turtle.right(90)
turtle.end_fill()
turtle.penup()
turtle.goto(20,-30)
turtle.pendown()
turtle.pencolor("yellow")
turtle.fillcolor("yellow")
turtle.begin_fill()
for _ in range(5):
turtle.forward(50)
turtle.right(144)
turtle.end_fill()
turtle.penup()
turtle.goto(80,-20)
turtle.begin_fill()
for _ in range(5):
turtle.forward(30)
turtle.right(144)
turtle.end_fill()
turtle.goto(90,-40)
turtle.begin_fill()
for _ in range(5):
turtle.forward(30)
turtle.right(144)
turtle.end_fill()
turtle.goto(75,-60)
turtle.begin_fill()
for _ in range(5):
turtle.forward(30)
turtle.right(144)
turtle.end_fill()
turtle.goto(60,-80)
turtle.begin_fill()
for _ in range(5):
turtle.forward(30)
turtle.right(144)
turtle.end_fill()
turtle.mainloop()