Step-by-Step Evaluation
1. x = False → so not x becomes:
2. Evaluate the right side of the and:
Remember Python operator precedence:
not has highest precedence
and comes next
or has lowest precedence
So the expression:
Now substitute the values:
-
y = True
z = False
- not y → not True → False
Then:
So:
3. Final expression:
✅ Final Output:
Summary:
not x → True
y or z and not y → True
True and True → ✅ True


0 Comments:
Post a Comment