标签:red color nbsp 基础 基础练习 fill 黄色 一个 begin
1、画一组同切圆
>>> turtle.circle(10)
>>> turtle.circle(20)
>>> turtle.circle(30)
>>> turtle.circle(40)
2、画一组同心圆
r=0
while(r<120):
turtle.up()
turtle.goto(0,-40-r)
turtle.down()
turtle.circle(40+r)
r=r+40
3、画一个五角星
>>> turtle.forward(300)
>>> turtle.left(144)
>>> turtle.forward(300)
>>> turtle.left(144)
>>> turtle.forward(300)
>>> turtle.left(144)
>>> turtle.forward(300)
>>> turtle.left(144)
>>> turtle.forward(300)
4、画一个黄色实心五角星
turtle.bgcolor("red")
>>> turtle.fillcolor("yellow")
>>> turtle.begin_fill()
>>> turtle.forward(300)
>>> turtle.left(144)
>>> turtle.forward(300)
>>> turtle.left(144)
>>> turtle.forward(300)
>>> turtle.left(144)
>>> turtle.forward(300)
>>> turtle.left(144)
>>> turtle.forward(300)
>>> turtle.end_fill()
标签:red color nbsp 基础 基础练习 fill 黄色 一个 begin
原文地址:http://www.cnblogs.com/zhuyinyinyin/p/7493117.html