1、自定义带参函数def yuan,画一个圆
import turtle as t
def yuan(x,y,z,color):
t.penup()
t.goto(x,y)
t.pendown()
t.pencolor(color)
t.pensize(3)
t.circle(z)
2、导入到主程序main
import txy
color=["blue","black","red","yellow","green"]*3
for i,j,color1 in zip(range(10,160,10),range(40,-120,-10),color):
txy.yuan(0,j,i,color1)
运行结果如下图:
