Note 5.11.2.
This workspace is provided for your convenience. You can use this activecode window to try out anything you like.
x*5 >= 10 and y-6 <= 20
will be evaluated so as to first perform the arithmetic and then check the relationships. The and
will be done last. Although many programmers might place parenthesis around the two relational expressions, it is not necessary.Level | Category | Operators |
---|---|---|
7(high) | exponent | ** |
6 | multiplication | *,/,//,% |
5 | addition | +,- |
4 | relational | ==,!=,<=,>=,>,< |
3 | logical | not |
2 | logical | and |
1(low) | logical | or |