Building upon what was taught in the Lists and For Loops mission, 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 mission, 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 mission, 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.
- Learn to use python conditionals such as if, else, and elif statements.
- Lean to use logical operators.
- Learn to use comparison operators.
- If Statements
- The Average Rating of Non-free Apps
- The Average Rating of Gaming Apps
- Multiple Conditions
- The or Operator
- Combining Logical Operators
- Comparison Operators
- The else Clause
- The elif Clause
- Next steps