I need help creating a python function that makes concentric circles. I already have a function that makes a circle(from the Python Programming book), so I thought I'd use a for loop; however, I'm not sure how. Here's what I have so far: (where 'number' is the number of circles, and 'distance' is the space between them)

``````def concentric (myTurtle,number,distance):
for i in range(1,number):
drawCircle(myTurtle,distance)
myTurtle.up()
myTurtle.left(90)
myTurtle.forward(spacing)
myTurtle.right(90)
myTurtle.down()``````

Any and all help would be greatly appreciated!

See other thread of same topic.

I did take a look at the other thread, but I'm trying to make concentric circles using a different method. I came up with more to add to it:

``````def concentric(myTurtle,number,distance)
for i in range(0,number+1,distance):
for i in range(number):
drawCircle(myTurtle,distance)
myTurtle.up()
myTurtle.left(90)
myTurtle.forward(distance)
myTurtle.right(90)
myTurtle.down()``````

Using this myTurtle draws the number of circles I want and correctly spaces them, but all the circles remain the same size instead of becoming increasing bigger/smaller.

Check the post where I revealed how to make to consentric circles. What is different to your code? Is the radius changing or same?

``````from turtle import *
r=100 ## radius of current circle
a=20 ## separation

circle(r)
## separation walk pen up
up()
left(90)
fd(a)
right(90) ## restoring direction
down()

r-=a

circle(r)
mainloop()``````

You have nested loop with same index variable in them both. You are not showing enough effort.

Get something really running code and we can help with the last glitches.

Get program running, experiment. Try to do with your body the movements of the turtle.

Compare situation in the beginning of consecutive loops. What should change, what is changing. How do you know to stop? How are you getting users input or are able to cope with different inputs or parameters?

Start and do not give up. Do not be afraid of things not running first time and running wrong next time.

Here is a Python module turtle example of how to draw two concentric circles ...

``````import turtle as tu

# distance between circles
distance = 30

# pen up
tu.up()
# move pen to point x, y
# keeps the center of the circle at canvas center
# pen down
tu.down()

# increase the radius value by distance

# pen up
tu.up()
# move pen to point x, y
# keeps the center of the circle at canvas center
# pen down
tu.down()