条件、循环、函数定义 练习

a五角星

a

 

 b同心圆用循环语句

import turtle

for i in range(5):
turtle.up()
turtle.goto(0,-20*(i+1))
turtle.down()
turtle.circle(20*(i+1))

 

 

c太阳花

import turtle
turtle.color('red','yellow')
turtle.begin_fill()
while True:
turtle.forward(200)
turtle.left(170)
if (abs(turtle.pos()))<1:
break
turtle.end_fill()

 d 5个五角星

posted on 2017-09-12 09:49  133陈贝  阅读(163)  评论(0编辑  收藏  举报