QuestionQ45

VerifiedControl Structures and Iteration

Review this code:

Question Image

What does this code output?

Explanation

Both string-membership tests in the if condition are true, and XOR (^) is false when both operands are true. The first elif condition is true because "2" occurs in a, so it prints blue.

Community Discussion

No comments yet. Be the first to start the discussion!