|
import turtle as t
def move(x,y):
t.penup()
t.goto(x,y)
t.pendown()
def fun1(c,d):
t.color(c)
t.begin_fill()
for a in range(3):
t.left(360/3)
t.forward(d)
t.end_fill()
def fun2(c,d):
t.color(c)
t.begin_fill()
t.circle(d)
t.end_fill()
def fun3(n,c,d):
t.color(c)
t.begin_fill()
for a in range(n):
t.left(360/n)
t.forward(d)
t.end_fill()
t.speed(0)
n = 5
t.color("#00FF00")
t.begin_fill()
for x in range(10):
move(x*30,x*30)
fun2("blue",10)
for x in range(10):
move(x*30,x*-20)
fun3(x,"red",20) |
|