6 / 15 Boolean Operator _And


#1

Need help big time with exercise:

6/15 Boolean Operator_AND
Let’s practice with and. Assign each variable to the appropriate boolean value.

Set bool_one equal to the result of
False and False

Set bool_two equal to the result of
-(-(-(-2))) == -2 and 4 >= 16 ** 0.5

Set bool_three equal to the result of
19 % 4 != 300 / 10 / 10 and False

Set bool_four equal to the result of
-(1 ** 2) < 2 ** 0 and 10 % 10 <= 20 - 10 * 2

Set bool_five equal to the result of
True and True


#2

Boolean AND expressions depend upon all operands to evaluate to True. They are said to short-circuit on False. That means that any operand that is False will force the entire expression to yield False.

 T == True
 F == False

 T and T and T and T  => True
 T and T and T and F  => False
 T and T and F and T  => False
 T and F and T and T  => False
 F and T and T and T  => False

From these we may conclude that

False and False  =>  False

#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.