Boolean expressions are best viewed as truth tables:

For a result to be true for "and" Both inputs must be true (denoted as 1). Any other combination and the result is false (denoted as 0).
For a result to be true for "or" either input must be true, if both are false then the output is false.
"Not" simply inverses the result.
Taking the first equation on line 4 we have:
Code
(2 <= 2) and "Alpha" == "Bravo"
We then simplify this, is 2 less than or equal to 2? Yes, so that input for the "and" is true (denoted as 1). Next the other half, is "Alpha" equal to "Bravo"? No, so that input is false (denoted as 0).
Now using the truth table for the "and" function we input a truth and a false (1 and 0) and in turn we get a result of 0 (false).
Now if you wanted to be cheeky you could do this for #7:
Code
(2 <= 2) and !("Alpha" == "Bravo")
Using the "not" operator on the alpha bravo comparison (which is false or 0) gives us back a 1 (true) from the "not" function. Finishing the equation we now have 1 and 1, which the result is 1 (true).
Similar cheekyness can be used for the or gates as well. Basically you don't need to change variables around and just change the operator functions. Just make sure they equate to the results you were expecting.
This post was edited by AbDuCt on Oct 7 2016 02:24am