HOLIDAY SALE! Save 50% on Membership with code HOLIDAY50. Save 15% on Mentorship with code HOLIDAY15.

10) Conditionals and Loops Lesson

Introduction: Python Conditional Statements

3 min to complete · By Martin Breuss

Generally, Python programs execute from top to bottom, from one statement to the next. But sometimes you don't want that. Programs get way more interesting once you can change this default order of execution. Control statements within the code allow you to change the flow of your programs.

Fork in the road in snowy forest. Photo by https://unsplash.com/@fairfilter Oliver Roos on Unsplash

Section Overview

In this section, you'll learn all about two ways of changing the control flow:

  1. Conditional statements
  2. Loops

Get ready to mix it up!

Recap: Boolean Values

You've learned about the Boolean values True and False earlier in this course. If you need to revisit them, head back to the previous section and revisit the lessons there. You'll see that these truth values are an important aspect of allowing Python to make decisions.

Once you're confident that you know True from False, you're ready to write code that allows your programs to make decisions.