[Python] Can someone help me with my Turtle coding? [closed]

Discussão em 'Python' iniciado por Stack, Março 17, 2025.

  1. Stack

    Stack Membro Participativo

    I'm here to ask if anyone could any of my two attached pictures, or help me with it

    https://i.sstatic.net/H3L3alQO.png

    https://i.sstatic.net/lfvk1X9F.png

    I tried to make the code like this:

    import turtle

    t = turtle.Turtle()
    t.speed(0) # Fastest speed
    t.hideturtle() # Hide the turtle cursor

    def draw_triangle(color, size):
    t.fillcolor(color)
    t.begin_fill()
    for _ in range(3): # A triangle has 3 sides
    t.forward(size)
    t.left(120) # Turn 120 degrees to make equilateral triangle
    t.end_fill()


    t.penup()
    t.goto(-100, 0)
    t.pendown()

    draw_triangle("red", 200)

    t.penup()
    t.goto(0, 0)
    t.pendown()

    draw_triangle("yellow", 100)

    t.penup()
    t.goto(-50, -100)
    t.pendown()

    draw_triangle("green", 150)


    and i would like someone to correct it

    Continue reading...

Compartilhe esta Página