Start building now

Choose how you want to begin this project.

Open it privately for practice or create a shared workspace to build it together.

No setup required • Guided steps inside the editor

Private practice

Open a private editor and work through the steps at your own pace.

Start project alone

Shared workspace

Create a live session so you can teach, pair, or build the project together.

What you'll build

A program that reads simple sensor records and totals activation time for a chosen date.

What you'll learn

  • How to work with stored records
  • How to filter data by date
  • How to total matching values
  • How to output a calculated result clearly

How it works

1

The user enters a date.

2

The program checks stored sensor activation records.

3

It adds together the seconds for records matching that date.

4

It prints the total number of seconds for the chosen date.

Build path

These steps appear inside the editor so you can build one part at a time.

  1. 1

    Step 1

    Ask for the date

    Use input() to store the date the user wants to check.

    Complete in the editorHint available
  2. 2

    Step 2

    Loop through the records

    Use a loop to go through each stored sensor date.

    Complete in the editorHint available
  3. 3

    Step 3

    Check for matching dates

    If a stored sensor date matches the target date, add the matching seconds value to total_seconds.

    Complete in the editorHint available
  4. 4

    Step 4

    Total the matching seconds

    Keep updating total_seconds until all records have been checked.

    Complete in the editorHint available
  5. 5

    Step 5

    Print the result

    Print a message such as: "Sensors were activated for 40 seconds on 05/02/2023".

    Complete in the editorHint available

More to explore

Browse more guided projects, or come back and start this one whenever you are ready.