If Statements in Everyday Life
This week you’ll be learning about conditional statements. While you may not be familiar with this term, you probably have used them in your everyday life. Conditional statements are phrases that say what would happen if certain conditions are met. Here are a few everyday examples
- If your room is messy, then you have to clean it.
- If you are hungry, then go find something to eat.
- If it is late, then go to bed.
- If it is cold, then put on a jacket.
- If this condition is true then these actions will occur.
If Statements in Python
Now, lets bring these statements to life in Python,
Here is an example of an If statement in Python:
Here is an example of an If statement in Python:

Remember: A huge part of coding is having the proper syntax. If you look at the example above, the print statement is aligned under the num variable. This is known as indentation, where the code is in a specific place to complete the statement. Make sure that the code is properly indented or it could result in a compiling error. If you are having trouble with this, refer to the code above for the proper indentation for conditional statements. In addition, make sure you add a colon after your conditional statement. Don’t forget the “:” after num>0 or you will have an error!
Now you are ready to start creating your own conditional statements, based on your work with booleans and variables!
Now you are ready to start creating your own conditional statements, based on your work with booleans and variables!