标签:break col 定义 yellow i+1 练习 forward begin nbsp
画五角星
import turtle
for i in range(5):
turtle.forward(150)
turtle.left(144)
画同心圆
import turtle
for i in range(5):
turtle.up()
turtle.goto(0,-20*(i+1))
turtle.down()
turtle.circle(20*i)
画太阳花
import turtle
turtle.color(‘red‘,‘blue‘)
while True:
turtle.forward(150)
turtle.left(170)
if(abs(turtle.pos()))<1:
break
画五个角星
import turtle
turtle.color(‘yellow‘)
turtle.bgcolor(‘red‘)
turtle.fillcolor(‘yellow‘)
def mygoto(x,y):
turtle.up()
turtle.goto(x,y)
turtle.down()
def ye(r):
turtle.begin_fill()
for i in range(5):
turtle.forward(r)
turtle.right(144)
turtle.end_fill()
mygoto(-320,250)
ye(100)
mygoto(-160,300)
ye(25)
mygoto(-110,250)
ye(25)
mygoto(-110,190)
ye(25)
mygoto(-160,140)
ye(25)
标签:break col 定义 yellow i+1 练习 forward begin nbsp
原文地址:http://www.cnblogs.com/wangze019/p/7509691.html