作业3——turtle

     import turtle

1、画一组同切圆

    turtle.circle(20)

    turtle.circle(50)

    turtle.circle(80)

    turtle.circle(110)

2、画一组同心圆

    turtle.up()

    turtle.goto(0,-10)

    turtle.down()

    turtle.circle(10)

    turtle.up()

    turtle.goto(0,-20)

    turtle.down()

    turtle.circle(20)

    turtle.up()

    turtle.goto(0,-30)

    turtle.down()

    turtle.circle(30)

3、画一个五角星

    turtle.forward(100)

    turtle.left(144)

    turtle.forward(100)

    turtle.left(144)

    turtle.forward(100)

    turtle.left(144)

    turtle.forward(100)

    turtle.left(144)

    turtle.forward(100)

4、画一个黄色实心五角星

    turtle.color('yellow')

    turtle.fillcolor('yellow')

    turtle.begin_fill()

    turtle.forward(100)

    turtle.left(144)

    turtle.forward(100)

    turtle.left(144)

    turtle.forward(100)

    turtle.left(144)

    turtle.forward(100)

    turtle.left(144)

    turtle.forward(100)

    turtle.end_fill()

posted @ 2017-09-08 09:50  lililililililli  阅读(139)  评论(0编辑  收藏  举报