๐ŸŒ Refugee Work ยท Learn Skills
โ† Learning Path
๐Ÿ Python Beginner

๐Ÿ”€ 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 :.