python作业



 1 import turtle
 2 turtle.setup(800,400,200,200)
 3 turtle.pensize(2)
 4 turtle.fillcolor("red")
 5 turtle.begin_fill()
 6 turtle.fd(180)
 7 turtle.seth(-144)
 8 turtle.fd(180)
 9 turtle.seth(72)
10 turtle.fd(180)
11 turtle.seth(-72)
12 turtle.fd(180)
13 turtle.seth(144)
14 turtle.fd(180)
15 turtle.end_fill()

 

 1 import turtle
 2 turtle.setup(800,400,200,200)
 3 turtle.pensize(2)
 4 for i in range(3):
 5     turtle.fd(180)
 6     turtle.seth(-120*(i+1))
 7 turtle.fd(60)
 8 turtle.seth(60)
 9 turtle.fd(-120)
10 for i in range(2):
11     turtle.fd(180)
12     turtle.seth(-60*(i+1))
13 turtle.seth(-180)
14 turtle.fd(180)

 

 1 import turtle
 2 turtle.setup(800,400,200,200)
 3 turtle.pensize(2)
 4 for i in range(3):
 5    turtle.fd(100)
 6    turtle.seth(-120*(i+1))
 7 turtle.seth(60)
 8 turtle.fd(-100)
 9 for i in range(2):
10     turtle.fd(200)
11     turtle.seth(-60*(i+1))
12 turtle.seth(-180)
13 turtle.fd(200)

 

 

posted @ 2020-03-11 21:55  木彳  阅读(122)  评论(0编辑  收藏  举报