五星红旗

import turtle as t

t.penup()
t.goto(-330,220)
t.pendown()
a=1
t.fillcolor('red')
t.color('red')
t.begin_fill()
while a<=4:
    if a%2==1:
        t.fd(660)
    else:
        t.fd(440)
    t.rt(90)
    a+=1
t.end_fill()
#画五角星
t.penup()
t.goto(-286,132)
b=1
t.fillcolor('yellow')
t.color('yellow')
t.begin_fill()
while b<=5:
    t.fd(132)
    t.right(144)
    b+=1
t.end_fill()

t.penup()
t.goto(-88,176)
b=1
t.fillcolor('yellow')
t.begin_fill()
t.right(156)
while b<=5:
    t.fd(44)
    t.right(144)
    b+=1
t.end_fill()

t.penup()
t.goto(-88,132)
b=1
t.fillcolor('yellow')
t.begin_fill()
t.right(180)
while b<=5:
    t.fd(44)
    t.right(144)
    b+=1
t.end_fill()

t.penup()
t.goto(-66,88)
b=1
t.fillcolor('yellow')
t.begin_fill()
t.right(90)
while b<=5:
    t.fd(44)
    t.right(144)
    b+=1
t.end_fill()

t.penup()
t.goto(-88,22)
b=1
t.fillcolor('yellow')
t.begin_fill()
t.right(90)
while b<=5:
    t.fd(44)
    t.right(144)
    b+=1
t.end_fill()

t.penup()
t.goto(500,0)
t.done()

 

posted @ 2025-03-03 00:39  广东吴亦几  阅读(16)  评论(0)    收藏  举报