Python practice
Your first Python practice project: a weekly study planner
By Kshurika Academy · Updated
After learning a few Python concepts, it helps to combine them in one small program. This study planner uses a list of sessions, adds their durations and compares the total with a weekly target. You can run it with Python 3 on your computer or in a Python learning environment you already use.
Define the problem before writing code
Suppose you plan three study sessions: Python basics, speaking practice and a small project. Each session has a name and a duration in minutes. Your program should print the plan and tell you how much time remains against a target of 180 minutes.
Keep the first version simple. It does not need accounts, a database or a calendar interface. Write the expected total on paper first: 30 + 20 + 45 is 95, leaving 85 minutes. This gives you a result to check against.
Build a version you can explain
Type the example and run it. A list stores the sessions; each tuple holds a name and a duration. The function walks through the list and returns a total. Indentation tells Python which statements belong inside the function and loop.
sessions = [("Python basics", 30), ("Speaking practice", 20), ("Project", 45)]
def total_minutes(plan):
total = 0
for name, minutes in plan:
total += minutes
return total
weekly_target = 180
planned = total_minutes(sessions)
for name, minutes in sessions:
print(f"{name}: {minutes} minutes")
print(f"Planned: {planned} minutes")
if planned < weekly_target:
print(f"Still to plan: {weekly_target - planned} minutes")
else:
print("You have planned enough time for your target.")Check more than the happy path
Start by confirming the expected total of 95 minutes. Then try an empty list, a plan totalling exactly 180 minutes and a plan above the target. Predict the output before running each version.
This version assumes every duration is a non-negative number. If you later let someone type durations, you will need to validate the input. A negative duration should not silently reduce the planned study time. Deciding how to handle unsuitable input is part of building a useful program.
Extend one behaviour at a time
Choose one extension, describe its expected behaviour and implement it before adding another. If the program breaks, the smaller change is easier to investigate.
- Add another session and verify the new total by hand.
- Print the number of sessions and the longest session.
- Reject a negative duration with a clear message.
- Group sessions by day, then calculate a total for each day.
Turn the exercise into evidence of learning
Save the program with a short note explaining the problem, how to run it, what you tested and one limitation. Record yourself explaining why the loop is needed and what the function returns. If you used an AI assistant, check every change by running the program and explaining it in your own words.
You do not need an impressive interface for a first project. A small program that you can explain, test and improve is a useful foundation for the next lesson. Kshurika’s Python Fundamentals course page lists the current syllabus and fees if you want to explore guided live learning.