๐ Lesson 3: if Statements
Learn how Python makes decisions using conditions.
Learning progress
3 / 4
๐ค What is an if statement?
An if statement lets Python check a condition.
If the condition is true, Python runs the indented code underneath it.
๐ก Example
score = 80
if score >= 60:
print("You passed!")
๐ฏ Your Challenge
Create a variable called score and give it a number.
Then use an if statement to check whether the score is at least 60.
If it is, print "You passed!".
โ๏ธ Try it yourself!
Output will appear here.
๐ก Tip: An if statement ends its condition with a colon :.