题目:绘制下面的图形

python turtle 100-73
Python 海龟绘图 100 题——第 73 题

解析:

绘制层叠的圆。注意每次画完后腰移动圆的位置。

答案:

方法一 使用循环绘制圆
Python
import turtle as t
s = 20
for i in range(0, 5):
    for i in range(0, 360):
        t.fd(0.0174*s)
        t.rt(1)
    t.lt(90)
    t.pu()
    t.fd(10)
    t.pd()
    t.rt(90)
    s = s + 10
方法二 使用 circle 方法绘制圆(不用 -s,则需要调整方向)
Python
import turtle as t
s = 20
for i in range(0, 5):
    t.circle(-s)
    t.lt(90)
    t.pu()
    t.fd(10)
    t.pd()
    t.rt(90)
    s = s + 10