What are A and B in programming?
In the graphic shown here we can think of A and B as statements.
In programming, a statement can be thought of as something that has some result. Take, for example, what we’ve been writing so far:
10 < 1 results in
(30 + 1) != 3 results in
So A and B are just statements like those, and they can be as complex as you want. Then we use
not as operators on these statements to make what we call expressions. An expression is just something that results in some value,
False in this case.
If you want a challenge, take a look at the example below that’s a bit more than what we’ve done so far. If it doesn’t make sense, that’s totally fine! You will understand it in the exercises to come!
left_half = (100 + 10) >= (20 - 5) # True right_half = (25 / 5) == 70 # False bool_complex_false = left_half and right_half # True AND False is False!