184k views
3 votes
The following statement will check to see if the turtle's pen color is 'green':

if turtle.pencolor() = 'green'
a) True
b) False

User Rook
by
7.6k points

1 Answer

3 votes

Final answer:

The statement will evaluate if the turtle's pen color is 'green' and return True if it is.

Step-by-step explanation:

The given statement checks whether the turtle's pen color is 'green'. To compare the pen color with 'green' in Python, we use double equal signs (==) instead of a single equal sign (=), which is used for assignment. Therefore, the correct statement should be:

if turtle.pencolor() == 'green'

If the turtle's pen color is 'green', the condition will evaluate to true, so the answer is option a) True.

User Harald Schilly
by
7.7k points