0
How can I interpret "if not 1+1 ==y or x==4 and 7==8"
How can I interpret "if not 1+1 ==y or x==4 and 7==8" - doesn't it mean that if either of "1+1==y" and "x==4 and 7==8" is false?
2 Antworten
+ 6
No, they should be in parenthesis to do that. ("not" changes only the first statement)
Simplified:
if 1+1!=y or x==4 and false
=>
if 1+1!=y
=>
if y!=2==true
+ 5
this is the explanation:
x = 4
y = 7
not 1+1 ==y or x==4 and 7==8
so lets elaborate,
(not 1+1==y ) //--> not 2 == 7 //--> not false // TRUE <-- answer on the first problem
=>
(X == 4) //--> 4 == 4 //--> TRUE <-- answer on the second problem
=>
(7==8) //--> FALSE <-- answer on the third problem
lets combine all.
(TRUE or TRUE) and FALSE //--> TRUE or TRUE is TRUE
=>
TRUE and FALSE is FALSE
so the answer is False,