[Python] Drawing a spiral in a spiral using Python turtle

Discussão em 'Python' iniciado por Stack, Agosto 24, 2025.

  1. Stack

    Stack Membro Participativo

    What is wrong with my code for turtle angie? I want her to spiral inside brad's square circle.

    My Code:

    import turtle

    def draw_square(some_turtle):

    for i in range (1,5):
    some_turtle.forward(200)
    some_turtle.right(90)

    def draw_art():
    window = turtle.Screen()
    window.bgcolor("black")
    #Turtle Brad
    brad = turtle.Turtle()
    brad.shape("turtle")
    brad.color("yellow")
    brad.speed(6)
    brad.pensize(2)
    for i in range(1,37):
    draw_square(brad)
    brad.right(10)
    #Turtle Angie
    angie = turtle.Screen()
    angie.shape("turtle")
    angie.color("blue")
    angie.speed(5)
    angie.pensize(2)
    size=1
    while (True):
    angie.forward(size)
    angie.right(91)
    size = size + 1

    window.exitonclick()

    draw_art()


    Here are photos of I what I want it to look like. I want the outer part of the brad showing and then the circle inside to include the spiral. It should look like the spiral image attached. Thanks!

    [​IMG] [​IMG]

    Continue reading...

Compartilhe esta Página