Back to Course

Introduction to Python

0% Complete
0/0 Steps
  1. Python: Basics
    15 Quizzes
  2. Python: Control Flow
    12 Quizzes
  3. Python: Errors
    5 Quizzes
Lesson 2, Topic 12
In Progress

Python: Control Flow Review

Yasin Cakal 20 Oct 2021
Lesson Progress
0% Complete

Excellent work! We covered a lot of ground in this lesson and more than doubled the number of tools in our Python toolkit. Let us summarize what we learned in this lesson:

  • Boolean expressions are statements with a True or False value.
  • A boolean variable is one that has a value of True or False.
  • Using relational operators, we can create the following boolean expressions:
    • Equals ==
    • Not Equals !=
    • Greater Than >
    • Greater Than or Equal to >=
    • Less Than <
    • Less Than or Equal to <=
  • if statements can be used in your code to establish control flow.
  • else statements can be used to execute code when an if statement’s conditions are not met.
  • elif statements are a convenient way to incorporate additional checks into your if statements.
  • randint() function from the random module can be used to generate a random integer.

Let’s test what you learned in this lesson!

%d bloggers like this: