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

Every mission has its data

A duration alone does not tell us whether a mission is finished. Let us collect title, minutes and status in a record with clear names.

Learning paths10 min

Let's discover together

  1. 1

    A dictionary maps keys to values: {"title": "Tico", "minutes": 10, "done": False}. The keys explain each value’s role.

  2. 2

    task["minutes"] looks up a key, not a position. task["done"] = True updates a field. Looking up a missing key with brackets raises KeyError.

  3. 3

    We can store several dictionaries in a list. In the loop, if not task["done"] selects unfinished missions. False is a boolean; "False" would be a nonempty string.

  4. 4

    Tico and Luma are fictional mission names. Keep fields consistent and do not use real names, passwords or contacts for practice.

✦
YOUR MISSION

Represent a mission with a dictionary and traverse a list of records.

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.

tasks = [{"title": "Tico", "minutes": 10, "done": False},
         {"title": "Luma", "minutes": 20, "done": True}]
total = 0
for task in tasks:
    if not task["done"]:
        total += task["minutes"]
print(total)
Build your answers and check when you are ready.
A moment to understand

Why should done be False without quotes in this model?

I need a hint

Type and content must match the rule.

Loading your journey…

Take it with you

Add a fictional 5-minute mission. Test done as True and False and explain the difference. Editing its status does not mean performing the real mission.

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.