Python——用海龟画出一个同心圆

没注释的源代码

import turtle  #插入一个海龟 
turtle.pensize(5)
turtle.speed(5)
for i in range(1,5):  #进行5次循环
    turtle.penup()
    turtle.goto(0,-10*i)
    turtle.pendown()
    turtle.circle(20+i*10)
turtle.done()

注释的源代码

import turtle
turtle.pensize(5)
turtle.speed(5)
for i in range(1,5):
    turtle.penup()
    turtle.goto(0,-10*i)
    turtle.pendown()
    turtle.circle(20+i*10)
turtle.done()

你可能感兴趣的:(python,开发语言)