Working with data
1 def summarize(records):
2 totals = {}
3 for name, minutes in records:
4 saved = totals.get(name, 0)
5 totals[name] = saved + minutes
6 return totals
Keep your lesson, code, and AI tutor together. Turn what you learn into projects you can build yourself.
1 def summarize(records):
2 totals = {}
3 for name, minutes in records:
4 saved = totals.get(name, 0)
5 totals[name] = saved + minutes
6 return totals
.get()
for day, minutes in records:
totals[day] = totals.get(day, 0)
totals[day] += minutes
lesson.pyUpdated
test_lesson.pyPassed
Keep your courses, files, and projects in one local folder.
Connect VS Code to work in the editor you already use.
Find open-source issues that match what you’ve practiced.
OffCourse uses your lesson, code, and test output to explain errors and guide your next attempt.
OffCourse explains that Monday is missing from the dictionary. The learner starts each new day at zero using totals.get(day, 0). The updated code passes the three example checks.
Blueprint turns an idea into a realistic first version, with a clear scope, project structure, and a build order.
The Study Tracker plan logs the date, topic and minutes. tracker.py writes sessions to a CSV file, report.py reads those sessions and totals the week, and test_report.py checks repeated topics and empty weeks. Build the logger first, then the report, then test both.