标签:style rom import begin bsp forward strong color gre
1.画五角星
from turtle import*
for i in range(5):
forward(150)
right(144)
2.画同心圆
from turtle import*
for i in range(5):
circle(30*(i+1))
write(10-i)
up()
goto(0,-30*(i+1))
down()
3.画太阳花
from turtle import*
color(‘yellow‘,‘red‘)
bgcolor(‘green‘)
while True:
forward(180)
left(165)
if(abs(pos()))<1:
break
4.画五个角星
from turtle import*
setup(600,400,0,0)
color(‘yellow‘)
bgcolor(‘red‘)
fillcolor(‘yellow‘)
def wjqgoto(x,y):
up()
goto(x,y)
down()
wjqgoto(-250,75)
begin_fill()
for i in range(5):
forward(120)
right(144)
end_fill()
wjqgoto(-120,150)
begin_fill()
for i in range(5):
forward(60)
right(144)
end_fill()
wjqgoto(-80,100)
begin_fill()
for i in range(5):
forward(60)
right(144)
end_fill()
wjqgoto(-90,35)
begin_fill()
for i in range(5):
forward(60)
right(144)
end_fill()
wjqgoto(-120,-25)
begin_fill()
for i in range(5):
forward(60)
right(144)
end_fill()
标签:style rom import begin bsp forward strong color gre
原文地址:http://www.cnblogs.com/0542054ghgf/p/7509727.html