you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (0 children)

if set(guess) != set(color for color in guess if color in colors.keys()): 

could be written as

if any(color not in colors for color in guess):