Skip to content

Latest commit

 

History

History

lecture-06

Lecture 06: Control Flow

Goal for this Lecture

Introduce you to the basic mechanisms in Python to control the sequence in which instructions in your program are executed (control the "flow" of the program).

Contents

We will cover

  1. If/else statements to execute statements based on conditions at the time of execution
  2. for-Loops to execute statements multiple times
  3. while loops (to repeat code until a condition is met)

Learning Targets

After completing this lecture, you should be able to use the above mentioned flow control mechanisms in your Python programs.

Prerequisites

You should have

  • Python installed
  • Be able to interact with Jupyter Notebooks (preferably using Jupyter Lab)
  • Have an understanding of basic Python datatypes (in particular, bool variables)