+ 1
(False and True)
Can somebody explain why (False and True) is False, and (False or True) is True??
4 odpowiedzi
+ 18
오지석 Hey, the answer lays in AND and OR.
If condition is truthy AND falsy, it's always FALSE because you can't logically have true AND false at a same time.
If condition is truthy OR falsey, it's always TRUE because you have a truthy possibility here.
+ 7
In true OR false the result is true because it checks the first operand (true here) and returns the first operand value (true here ) if it is true and returns second if it is false.
AND is just opposite.
In false AND true
it returns second operand value(true here) if first operand is true and returns first operand value(false here) if first operand is false.
So, false AND true returns false and false OR true is true
+ 6
In my country there's a drink called 'KiBa'. It's made of cherry juice and banana juice.
To make KiBa, you need cherry AND banana, so if the first one isn't available (False) you don't need to look further - you won't get your KiBa.
If you just want to drink any fruit juice, cherry OR banana, one of them being available would do the job, right?
So if cherry is not available (False), you're not hopeless... just yet. You ask on: 'Well, do you have banana?'
Banana's available (True), so there you go!
0
And - read and true and true, if one false, your condition don't true.
Or - read or true or true, because enough only one true