Choosing with if
Run code only when something is true.
Making a Choice 🤔
Hello, decision maker! 🧠 Sometimes code needs to choose what to do. Like: IF it is raining, take an umbrella! ☔
The if Word 🪧
In Python we use the word if to make a choice. If something is true, the code inside runs!
age = 10
if age > 5:
print("You are a big kid!")All lessons in this course
- Choosing with if
- The else Backup Plan
- Comparing Values
- More Options with elif