CS110: Winter 2021

Intro to Computer Programming with Python

CS110: Winter 2021

Lessons > 10. 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

1. Download the Exercise Files

Exercise Files

2. Review the Slides

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

3. Review the Lecture Video(s)

Link Type Title Duration
Video 1 required Intro to conditionals 8:57
Video 2 required If and else 14:40
Video 3 required Elif 10:49
Video 4 required Logical operators and Truth Tables 22:22
Video 5 lecture Live Lecture 53:33

4. Review the References & Supplemental Materials

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

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

5. Do the Practice Quiz (Exercises)

Note: The quiz is to help you test your own understanding of the concepts. It is not graded, and is designed to help you to see what you already know and what you should review / ask about.
https://canvas.northwestern.edu/courses/130514/quizzes/132653