108k views
3 votes
What command would you use to change the turtle's pencolor to blue?

1) turtle.pencolor(blue)
2) turtle.pencolor('blue')
3) turtle.pencolor(0, 0, 255)
4) turtle.pencolor(0, 0, 1)

User RKI
by
8.2k points

1 Answer

5 votes

Final answer:

To change the turtle's pencolor to blue, you can use 'turtle.pencolor('blue')' or provide RGB values with 'turtle.pencolor(0, 0, 255)' or 'turtle.pencolor(0, 0, 1)' depending on the color mode.

Step-by-step explanation:

To change the turtle's pencolor to blue in the Turtle Graphics module in Python, you would use the command turtle.pencolor('blue'). This command sets the color using a string argument representing the name of the color. You can also use RGB (Red Green Blue) values to set the color with the command turtle.pencolor(0, 0, 255) or turtle.pencolor(0, 0, 1) if you're using a color mode where the values are normalized between 0 and 1.

User Jmoerdyk
by
8.6k points