Commit ae6cd602 by BellCodeEditor

save project

parent a57c8721
Showing with 20 additions and 7 deletions
...@@ -2,12 +2,24 @@ ...@@ -2,12 +2,24 @@
请使用turtle模块画出五角星 请使用turtle模块画出五角星
""" """
import turtle import turtle
pen=turtle.Pen() def SB(s,las,x,y):
pen.fillcolor("red") pen=turtle.Pen()
pen.begin_fill() pen.setx(x)
for i in range(5): pen.sety(y)
pen.forward(200) pen.fillcolor(s)
pen.begin_fill()
for i in range(5):
pen.forward(las)
pen.left(144) pen.left(144)
pen.end_fill() pen.end_fill()
pen.hideturtle() pen.hideturtle()
SB("blue",50,0,0)
SB("blue",20,0,100)
SB("orange",20,-100,100)
SB("red",50,100,100)
turtle.done() turtle.done()
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment