Python Capstone Project
Python Capstone Project
Great job reaching this point.
You have learned:
- Python basics
- Conditions
- Loops
- Functions
- Data structures
Now it is time to build one real project that uses everything together.
Project: School Management System
You will build a simple school system that can:
- Login
- Show students
- Add students
- View top student
- Show passing students
- Calculate average score
- Sort results
- Exit the program
This project uses:
- variables
- input
ifstatements- loops
- functions
- lists
- dictionaries
- sets
- sorting
- nested data
Step 1: Starter Data
Create this data first.
school = {
"name": "Bright Future Academy",
"teacher": "Maya",
"users": {
"username": "admin",
"password": "python123"
},
"students": [
{"name": "Tom", "score": 85},
{"name": "Sara", "score": 92},
{"name": "Ali", "score": 70}
]
}
Step 2: Login System
Ask the user for:
- username
- password
Rules:
- If entered username matches:
school["users"]["username"]
and entered password matches:
school["users"]["password"]
Print:
Login successful
- Otherwise print:
Invalid login
Then stop the program.
Step 3: Main Menu
After login, keep showing this menu in a loop:
1. Show Students
2. Add Student
3. Top Student
4. Passing Students
5. Average Score
6. Unique Scores
7. Exit
Ask the user to choose an option.
Step 4: Create Functions
Create these functions.
show_students()
Print all student names and scores.
Example output:
Tom 85
Sara 92
Ali 70
add_student(name, score)
Add a new student to the list.
If user enters:
John
88
Then add:
{"name": "John", "score": 88}
top_student()
Sort students by score highest first.
Print:
Top Student: Sara 92
passing_students()
Print only students with score 80 or more.
Example output:
Tom
Sara
average_score()
Return the average of all scores.
Example output:
Average: 82.33
unique_scores()
Use a set to print unique scores only.
Example output:
{85, 92, 70}
Step 5: Connect Menu Options
Use if / elif to run the correct function based on menu choice.
Example:
if choice == "1":
show_students()
elif choice == "2":
...
Step 6: Exit Option
If user chooses 7, print:
Goodbye
Then stop the loop.
Full Example Run
Login successful
1. Show Students
2. Add Student
3. Top Student
4. Passing Students
5. Average Score
6. Unique Scores
7. Exit
Choose: 1
Tom 85
Sara 92
Ali 70
Choose: 3
Top Student: Sara 92
Choose: 7
Goodbye
Extra Challenges
After finishing, try adding:
- Remove student
- Search student by name
- Update score
- Save to file later
- Teacher dashboard
- Grade letters (A, B, C)
Skills You Used
You used:
- Variables
- Strings and numbers
- Input and output
- Conditions
- Loops
- Functions
- Lists
- Dictionaries
- Sets
- Sorting
- Nested data
Real World Use Case
This project teaches the same logic used in admin systems, dashboards, student portals, and business tools.
Assignment
Build the full project by yourself. Then add at least one extra feature.
Summary
You created a real Python application that combines everything from Modules 1 to 5 into one complete project.