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 False, or (30 + 1) != 3 results in True.
So A and B are just statements like those, and they can be as complex as you want. Then we use and, or, and not as operators on these statements to make what we call expressions. An expression is just something that results in some value, True or 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!
A and B here are Statements . Its generally known as “PREPOSITION”.
A preposition is an atomic sentence which can result either true or false and nothing else .
eg. A= its Sunny outside.
B= My father is not at home .
you can see the answers to the statement A and B can either be true or false and nothing else . In computer language the value given to A and B are 0(false) and 1(true). By these values we can form premises.
To clear the confusion, they and not statements, but expressions. The lesson text is incorrect.
A and B in logical expressions are called operands, but they too are expressions.
"A"
is known as a string expression, which in logical terms is truthy since the string has a length greater than zero.
a + b
is an expression, that represents a value. All expressions represent a value whether it is numeric, string, boolean, data structure or anonymous function (lambda). All expressions have a logical value, as well… truthy or falsy.
Consider,
>>> a, b = 6, 7
>>> a + b > b + a
False
>>> a * b > b * a
False
>>>
The first line is a statement, the second and third are expressions.
As mentioned earlier, statements do not have a value. They are an instruction step. Notice how the last two lines echo a value, that is the evaluation of the expression.
The bottom line is that we can use all manner of expressions to construct a logical expression. It will all boil down to a single boolean value.