Python If, Else, Elif Statements
Building upon the Python Lists lesson and the Python For Loops lesson, you’ll continue to develop your Python programming skills by learning to answer questions using conditional statements, such as
In this lesson, you’ll learn concepts such as conditional statements to control the flow of your code, the Boolean values
False, and how to use comparison operators such as
!=. Combining all of these concepts is crucial for both a Python developer and a data scientist—the combination of Python conditionals gives you more control over your code. For example, if you have a list of mobile applications, and you want to compute the average, you could use conditional statements and comparison operators to see the average rating of apps that aren’t free vs. those that are free.
When you finish this lesson, you’ll feel more confident using For Loops and Conditional Statements in Python. 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 practical, like using for loops and
elif statements to perform calculations on a dataset.
- Learn how to use Python conditionals such as
- Lean how to use logical operators
- Learn how to use comparison operators
- Append Recap
- If Statements
- If Statement Fundamentals
- The Average Ratings of Non-free Apps
- The Average Rating of Gaming Apps
- Multiple Conditions