Rullst AcademyRullst Academy/Lesson
Python: from first line to project · Lesson 04 / 12

The decision is in the condition

A fifteen-minute mission fits exactly into a fifteen-minute slot. One symbol decides whether that boundary is accepted.

Learning paths10 min

Let's discover together

  1. 1

    if evaluates a condition. If true, it runs the indented block below; else offers the other path. A colon opens the block.

  2. 2

    Use four spaces of indentation consistently. In Python, indentation structures the program; it is not just decoration.

  3. 3

    minutes <= limit accepts equality. minutes < limit does not. == compares equality; = assigns a value.

  4. 4

    Here we show 1 when it fits and 0 otherwise. Test before, at and after the boundary: 14, 15 and 16 minutes. One example does not check every boundary.

✦
YOUR MISSION

Use if/else, comparisons and indentation; test equality at a boundary.

Now it's your turn

Discovery workshop

Read, predict, check

Compare the two versions. Show result reveals a prepared output: this panel does not run Python. Then practise with the activity file.
Mini experiment

Learning simulation: compare cards and check your predictions. The browser is not compiling Rust or starting a server.

minutes = 15
limit = 15
if minutes <= limit:
    print(1)
else:
    print(0)
Build your answers and check when you are ready.
A moment to understand

If the plan allows using exactly all the time, which comparison matches it?

I need a hint

The = beside < includes equality.

Loading your journey…

Take it with you

Run cases 14, 15 and 16 with limit 15. Record each output. Then change the rule and explain which boundary changed.

PYTHON · .py

Your Python workbench

Here you read and predict prepared outputs. To run the actual code, download the activity file, edit it on your computer and use Python. Rullst Academy grades lesson answers; it does not verify local execution.

Save and run

Extract the activity ZIP into its own folder. Open a terminal there and use your system’s command. If downloading your edited file separately, use its actual name in the command. Save before running again.

Windows
python lesson.py
macOS / Ubuntu
python3 lesson.py
My files and GitHub

The editor keeps a local draft and can send a .py file to GitHub with your confirmation. Download your edited code to preserve it. The ZIP is starter material; for the final project, also publish data and test files following PUBLISH.md.

At your own pace

My files and GitHub

Every lesson can become your own record: code, notes or a practice plan. Saving a file to GitHub is optional and does not change your XP.

Student guide

The editor and downloads open when this lesson is available to your account. Check access below or return to the track map.

Checking your access to this lesson…

Rullstpetbot

AI can make mistakes. Check the lesson material.