turtle库基础练习
- 画一组同切圆
>>> import turtle
>>> turtle.circle(20)
>>> turtle.circle(80) - 画一组同心圆
>>> import turtle
>>> turtle.circle(100)
>>> turtle.up()
>>> turtle.goto(0,50)
>>> turtle.down()
>>> turtle.circle(50) - 画一个五角星
>>> turtle.reset()
>>> import turtle
>>> 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.fillcolor("yellow")
>>> turtle.forward(100)
>>> turtle.left(144)
>>> turtle.forward(100)
>>> turtle.reset()
>>> turtle.color('yellow')
>>> turtle.fillcolor("yellow")
>>> turtle.begin_fill()
>>> for i in range(5):
turtle.forward(100)
turtle.left(144)
>>> turtle.end_fill()