CS110: Fall 2021

Intro to Computer Programming with Python

CS110: Fall 2021

Lessons > 11. 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 9:20
Video 2 If and else pre-recorded 15:03
Video 3 Elif pre-recorded 11:06
Video 4 Logical operators and Truth Tables pre-recorded 22:49
Video 5 Practice with conditional statements lecture 52:07

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

5. Take the Practice (Ungraded) Quiz

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/149580/quizzes/159807