for循环:用turtle画一颗五角星

import turtle
turtle.pencolor('red')
turtle.fillcolor('yellow')
turtle.begin_fill()

while True:
    turtle.forward(100)
    turtle.right(49)
    if abs(turtle.position())<1:
        break

turtle.end_fill()
turtle.done()

import turtle
turtle.bgcolor('red')
turtle.pencolor('yellow')
turtle.fillcolor('yellow')
turtle.begin_fill()
turtle.forward(300)
turtle.right(144)

turtle.forward(300)
turtle.right(144)

turtle.forward(300)
turtle.right(144)

turtle.forward(300)
turtle.right(144)

turtle.forward(300)
turtle.right(144)

turtle.end_fill()
turtle.done()

posted @ 2018-05-09 21:11  BiuBiu怪  阅读(121)  评论(0编辑  收藏  举报