import turtle t=turtle.Pen() t.circle(50) t.penup() t.goto(0,-50) t.pendown() t.circle(100) t.penup() t.goto(0,-100) t.pendown() t.circle(150) turtle.done()
import turtle t=turtle.Pen() t.circle(50) t.penup() t.goto(0,-50) t.pendown() t.circle(100) t.penup() t.goto(0,-100) t.pendown() t.circle(150) turtle.done()
绘制不同颜色的多个同心圆
import turtle
t = turtle.Pen()
my_colors=('red','green','pink','black')
t.speed(10)
for i in range(10):
t.penup()
t.goto(0,-i*10)
t.pendown()
t.color(my_colors[i%len(my_colors)])
t.circle(15+i*10)
turtle.done()