CodingNeed.

2 · Make decisions · 8 MIN

Choose a path

Conditions choose which instructions run.

An if block runs when its condition is true. A colon starts the block and indentation groups its statements. else handles the other case. >= includes the boundary.

A door opens if your ticket is valid. Otherwise, it stays closed.

Read the example

score = 70
if score >= 60:
    print("Pass")
else:
    print("Try again")
Check the expected output
Pass

Your challenge

Return "Pass" for scores at least 60; otherwise return "Try again".

Common trap

Use consistent indentation and include each colon.

Next lesson: Read and fix an error