python 基础

import turtle

turtle.setup(600, 400, 0, 0)

turtle.color("yellow")
turtle.bgcolor("red")
turtle.fillcolor("yellow")


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


def whr_draw(r):
    turtle.begin_fill()
    for i in range(5):
        turtle.forward(r)
        turtle.right(144)
    turtle.end_fill()


whr_goto(-600, 220)
whr_draw(150)

whr_goto(-400, 295)
whr_draw(50)

whr_goto(-350, 212)
whr_draw(30)

whr_goto(-350, 145)
whr_draw(30)

whr_goto(-400, 90)
whr_draw(30)

 

 

posted on 2018-03-15 14:19  140-吴华锐  阅读(99)  评论(0编辑  收藏  举报