def Rect():
t.color("red","red")
t.begin_fill()
t.penup()
t.goto(300,200)
t.pendown()
t.goto(-300,200)
t.goto(-300,-200)
t.goto(300,-200)
t.goto(300,200)
t.goto(0,0)
t.end_fill()
def Star(x,y,m,n):
t.penup()
t.color("yellow","yellow")
t.goto(x,y)
t.seth(m)
t.pendown()
t.begin_fill()
for i in range (5):
t.fd(n)
t.right(144)
t.end_fill()
import turtle as t
t.setup(1200,800,100,100)
t.speed(0)
t.pensize(5)
t.hideturtle()
Rect()
Star(-250,100,0,120)
Star(-100,150,60,30)
Star(-50,100,30,30)
Star(-50,50,0,30)
Star(-100,0,-30,30)
Python用turtle画红旗
最新推荐文章于 2024-07-09 23:56:48 发布