CS110: Spring 2025

Intro to Computer Programming with Python

CS110: Spring 2025

Lessons > 8. Conditional Execution & Boolean Logic

In this lesson, we’re going to go over conditional logic, which will allow you to write programs that have different outcomes depending on the data, events, and/or user interactions that take place as your program executes. This is often referred to as your program’s “state.” Specifically, we’ll cover: (a) if, if/else, if/elif…/else statements, (b) comparison operators, (c) truth tables, and (d) scenarios where you might want to use if/elif/else statements.

Today's Activities

For today, please do the following:

1. Download the Exercise Files

Exercise Files

2. Review the Slides

  1. Conditionals & Boolean Logic
  2. Supplementary Slides for Live Lecture

3. Watch the Lecture Video(s)

Link Title Type Duration
Video 1 Intro to conditionals pre-recorded 11:59
Video 2 If and else pre-recorded 20:13
Video 3 Elif pre-recorded 14:34
Video 4 Logical operators and Truth Tables pre-recorded 25:34

4. Review / Study the Supplemental Materials

Note: these readings / videos are suggested for additional context / examples, but not required.

  1. Severance Ch3: Conditionals.
    readingvideo
  2. Ch5: Conditionals. ThinkCS