Python - If Statements
📖 Read the lesson
Code Life
By Pierre Marsaa
What are Conditional Statements?
In programming, we often need our code to make decisions based on certain conditions, just like you do in real life!
For example, you might think: "If my Codémon has 0 HP, he's fainted." In Python, we can write similar instructions using conditional statements.
The most basic conditional statement is the
if
statement. It allows your program to check a condition and execute some code only if that condition is true.
Verify