79350630

Date: 2025-01-12 20:11:44
Score: 1
Natty:
Report link

The issue is in how u are comparing the color in code. When we call turtle.color() it return a tuple (pen_color , fill_color). And turtle.color is a method so comparing will not work.

This can be done depending on what color u want to access either pen_color or fiil_color.

turtle.color("green")

turtle.color()

('green', 'green')

turtle.color()[0] #pen_color

("green")

turtle.color()[1] #fill_color

("green")

turtle.color()==("green")

False

turtle.color()==('green', 'green')

True

turtle.color()[1] == "green"

True

turtle.color()[0] == "green"

True

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Disha Holmukhe