Lesson: Conditional Statements
Building upon what was taught in the Lists and For Loops lesson, you will continue to build and refine your Python programming skills by learning to answer more granular questions using conditional statements such as if, else, and elif statements.
In this lesson, you'll learn concepts such as conditional statements to control the flow of your code, the logical operators such as AND and OR, and how to use comparison operators such as
<=, etc. Combining all of these concepts is crucial for both a Python developer and a data scientist — the combination of Python conditionals allows you to have more control of your code. For example, if you had a list of mobile applications and you wanted to compute the average, you could use conditional statements and comparison operators to see the average rating of apps that are not free versus those that are free.
Upon completion of this lesson, you'll feel more confident in using Python for data science. If you feel like you need practice, feel free to think of something you can create using what you've learned so far; it doesn't have to be big, it can be something, small like a calculator.
1. If Statements
3. The Average Rating of Non-free Apps
4. The Average Rating of Gaming Apps
5. Multiple Conditions
6. The or Operator
7. Combining Logical Operators
8. Comparison Operators
9. The else Clause
10. The elif Clause
11. Next steps