python基础

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

turtle.setup(600,400,0,0)
turtle.color('yellow')
turtle.bgcolor('red')
turtle.fillcolor('yellow')

gogo(-250,70)

turtle.begin_fill()
for i in range(5):
    turtle.forward(100)
    turtle.right(144)
turtle.end_fill()

gogo(-100,150)
turtle.begin_fill()
for i in range(5):
    turtle.forward(50)
    turtle.right(144)
turtle.end_fill()

gogo(-80,80)
turtle.begin_fill()
for i in range(5):
    turtle.forward(50)
    turtle.right(144)
turtle.end_fill()

gogo(-80,10)
turtle.begin_fill()
for i in range(5):
    turtle.forward(50)
    turtle.right(144)
turtle.end_fill()

gogo(-100,-60)
turtle.begin_fill()
for i in range(5):
    turtle.forward(50)
    turtle.right(144)
turtle.end_fill()
turtle.done()

 运行截图:

 

posted @ 2018-03-15 18:58  144+粱肇森  阅读(98)  评论(0编辑  收藏  举报