Sep 08: Boolean Logic, Conditions
Learning Objectives
After today's class, you should be able to:
- Describe the responsibility of each team role (Manager, Presenter, Recorder, Reflector).
- Evaluate boolean expressions with comparison operators (
<
,>
,<=
,>=
,==
,!=
). - Evaluate boolean expressions that involve comparisons with
and
,or
, andnot
.
Reminders¶
- Read Ch 3 – ideally:
- 1st half before Friday
- 2nd half before Monday
- Submit HW 3 – ideally:
- 1 and 2 before Friday
- 3 and 4 before Monday
POGIL Activity¶
- Conditions and Logic
- If you are absent today, complete this activity at home
- Bring your completed activity to class or office hours
- Optional: To learn more about POGIL, check out pogil.org
- POGIL Role Cards (used in today's Meta Activity)
Example Code¶
Model 1
type(True)
type(true)
type(3 < 4)
print(3 < 4)
three = 3
four = 4
print(three == four)
check = three > four
print(check)
type(check)
print(three = four)
three = four
print(three == four)
Model 2
a = 3
b = 4
c = 5
print(a < b and b < c)
print(a < b or b < c)
print(a < b and b > c)
print(a < b or b > c)
print(not a < b)
print(a > b or not a > c and b > c)