[Python] Attempting to change the square color that's printed

Discussão em 'Python' iniciado por Stack, Fevereiro 4, 2025.

  1. Stack

    Stack Membro Participativo

    I'm attempting to change the square color that comes out to what the user inputs when I run the code in the terminal, right now in turtles the color of the squares that comes out is black regardless of what color that I input. How would I go about rectifying this please.

    if __name__ == "__main__":
    pen_size = int(input("Enter the pen size: "))
    color_options = ["red", "blue", "green", "black"]
    print("Choose a pen color:", color_options)
    pen_color = input ("Tom.pencolor")
    square_size = int(input("Enter the size of the squares: "))


    draw_squares(pen_size, square_size)


    (https://i.sstatic.net/08dcnICY.jpg)

    Continue reading...

Compartilhe esta Página