Skip to content

Sep 06: 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, and not.

Reminders

Remember: the goal is to learn, not just to get the HW done!

  • 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

First Year Kickoff

Join us on Wed, Sep 11th at 5:15–6:00pm in EnGeo 2301. All first-year CS and IT majors are expected to attend. Free Pizza! 🍕

Please RSVP here – click here now, pretty please!

For students who are unable to attend the Kickoff event, the CS Ambassadors will hold two “First Year Success” workshops:

  • Wed 9/25 11:30–12:30, King 243
  • Thu 9/26 4:00–5:00, King 236

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

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)