Python

If Statements

An if statement runs code only when a condition is true.

age = 18
if age >= 18:
    print("You are an adult")

Important: Code inside if must be indented (4 spaces).

Comparison Operators

OperatorMeaning
==Equal to
!=Not equal
>Greater than
<Less than
>=Greater or equal
<=Less or equal

Your Task

Create a variable score = 85. If it's greater than or equal to 70, print "Pass".

script.py
Loading PYTHON engine...
Downloading Python… (one-time, ~10 MB)

Downloading Python… (one-time, ~10 MB)

This runs entirely in your browser and is cached for next time.