A. Introduction
While making decisions, we often need to compound multiple conditions. For instance, 1<x<10 requires x>1 AND x<10. How to say AND in Python? What about x>1 OR y<1?
B. Notes:
1. A boolean expression (or logical expression) evaluates to one of two states true or false. Python provides the boolean type that can be either set to False or True. Many functions and operations return boolean values.
The not keyword can also be used to inverse a boolean value.
>>> not True
False
The evaluation using the and and or operators follow these rules:
and and or both evaluate expressions from left to right while and have higher precedence.
with and, if all values are True, returns the last evaluated value. If any value is False, returns the first False value, and ignores the rest. This is called short-circuit.
or returns the first True value, and ignores the rest(short-circuit). If all are False, returns the last False.
Summary:
x Returns True if x is True, False otherwise
x and y Returns x if x is False, y otherwise
x or y Returns y if x is False, x otherwise
2. Examples
3. Operator Precedence: See the table below. Highest precedence at the top, lowest at the bottom. Operators in the same box evaluate left to right.

C. Try this:
1. Let the user enter three side lengths of a triangle as input, print out if it is an equilateral, Isosceles, or scalene triangle.
2. Let the user enter measurements of a triangle's three interior angles as input, print out if it is an acute, right, or obtuse triangle.
a = int(input("Please enter length of side A: ")) b = int(input("Please enter length of side B: ")) c = int(input("Please enter length of side C: ")) if a == b == c: print("Equilateral") elif a == b or a == c or b == c: print("Isoceles") else: print("Scalene") a = int(input("Please enter measure of angle A: ")) b = int(input("Please enter measure of angle B: ")) c = int(input("Please enter measure of angle C: ")) if (a == 90 or b == 90 or c == 90) and a+b+c == 180: print("Right") elif (a > 90 or b > 90 or c > 90) and a+b+c == 180: print("Obtuse") elif a+b+c == 180: print("Acute")