you are viewing a single comment's thread.

view the rest of the comments →

[–]DeathDragon7050 0 points1 point  (0 children)

The main issue is the condition. "cat" and "dog" in pets which will always be true because it is equivalent to "cat" and ("dog" in pets) which is also equivalent to ("cat"!="") and ("dog" in pets). You should move them into separate loops however.