10. Logical expressions¶
We can combine logical operators to form complex logical expressions
The evaluation order is:
not
>and
>or
. This means that in an expression, thenot
logical operator is evaluated first, thenand
, and finallyor
.
Let’s see an example:
10.1. Example¶
The conditions for granting a motorcycle purchase loan are: having a salary greater than $1,000.00 and being over 18 years old. Check if José can get the loan:
10.2. Example¶
Check if a student passed given that they obtained an average score of 5.8 in the exercise program and obtained an average score of 7 in the tests:
You have attempted of activities on this page