Python基础综合练习

import turtle
import time

turtle.bgcolor("red")
turtle.pencolor("yellow")
turtle.fillcolor("yellow")
turtle.setup(700, 500)

def lgoto(x,y):
turtle.up()
turtle.goto(x,y)
turtle.down()

def draw(d):
turtle.begin_fill()
for _ in range(5):
turtle.forward(d)
turtle.right(144)
turtle.end_fill()

lgoto(-300,130)
draw(100)

lgoto(-170,200)
draw(50)

lgoto(-110,150)
draw(50)

lgoto(-110,90)
draw(50)

lgoto(-170,30)
draw(50)
turtle.hideturtle()
turtle.done()



 

posted @ 2018-03-19 19:15  086刘伟锋  阅读(161)  评论(0编辑  收藏  举报