Python基础综合练习
from turtle import *
def position(x,y):
up()
goto(x,y)
down()
def draw(size,x,y):
position(x,y)
color('yellow')
begin_fill()
fillcolor('yellow')
for i in range(5):
forward(size)
if(size==150):
right(144)
else:
left(144)
end_fill()
bgcolor('red')
#速度
speed(5)
#画大星
draw(150,-300,160)
#画四个小星
draw(50,-180,250)
draw(50,-80,200)
draw(50,-80,90)
draw(50,-180,10)
#省略箭头
hideturtle()
done()


浙公网安备 33010602011771号