4.9k views
1 vote
Write a python code using tracy turtle to draw the following shape

Write a python code using tracy turtle to draw the following shape-example-1
User Arshak
by
6.1k points

1 Answer

0 votes

Answer:

import turtle

t = turtle.Turtle()

R = 20

N = 8

def rect(x,y,w):

t.penup()

t.setpos(x,y)

t.pendown()

for _ in range(4):

t.left(90)

t.forward(w)

rect(0,0,R*N)

rect(R*N,0,R*N)

rect(0,-R*N,R*N)

rect(R*N,-R*N,R*N)

for x in range(1,N+1):

t.penup()

t.setpos(0,-R*x)

t.pendown()

t.circle(R*x)

Step-by-step explanation:

Not a turtle expert, but this seems to do the job.

User Jlodenius
by
6.1k points