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 aloneShared 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
The user enters a date.
The program checks stored sensor activation records.
It adds together the seconds for records matching that date.
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
Step 1
Ask for the date
Use input() to store the date the user wants to check.
- 2
Step 2
Loop through the records
Use a loop to go through each stored sensor date.
- 3
Step 3
Check for matching dates
If a stored sensor date matches the target date, add the matching seconds value to total_seconds.
- 4
Step 4
Total the matching seconds
Keep updating total_seconds until all records have been checked.
- 5
Step 5
Print the result
Print a message such as: "Sensors were activated for 40 seconds on 05/02/2023".
More to explore
Want a different challenge?
Browse more guided projects, or come back and start this one whenever you are ready.