Program11
11. Develop Student Grade Tracker: Accept multiple students’ names and marks. Store them in a list of tuples or dictionaries. Display summary reports (average, topper, etc.).
Objective of the Program
To understand list of dictionaries / tuples
To store structured data
To perform aggregate calculations
To generate summary reports
To practice real-world data handling
Logical Construction (Think Before You Code)
Suppose input is:
| Name | Marks |
|---|---|
| Rahul | 85 |
| Sneha | 92 |
| Arjun | 78 |
We must:
Store data properly
Compute:
Average
Maximum
Minimum
Identify topper
Display formatted output
Data Structure Choice
We will use list of dictionaries:
[
{'name': 'Rahul', 'marks': 85},
{'name': 'Sneha', 'marks': 92}
]
Why dictionary?
Easy to access by key
More readable
Better than tuple for beginners
π Key Idea:
Store → Process → Report
Flowchart (Block Diagram of Logic)
Start
Read number of students
Loop to read name and marks
Store in list
Calculate total marks
Find highest & lowest
Compute average
Display summary
Stop
Algorithm
Start
Read number of students
Initialize empty list
For each student:
Read name
Read marks
Store as dictionary in list
Calculate total marks
Compute average
Find student with maximum marks
Find student with minimum marks
Display summary report
Stop
Python Program (With Gaps for Students)
⚠ Students must complete missing parts.
# Student Grade Tracker
n = int(input("Enter number of students: "))
students = []
for i in range(n):
name = input("Enter student name: ")
marks = float(input("Enter marks: "))
students.append({"name": ____________, "marks": ____________})
total = 0
for student in students:
total += student["__________"]
average = total / ____________
topper = students[0]
lowest = students[0]
for student in students:
if student["marks"] > topper["marks"]:
topper = student
if student["marks"] < ____________:
lowest = student
print("\n----- Summary Report -----")
print("Average Marks:", average)
print("Topper:", topper["name"], "-", topper["marks"])
print("Lowest Scorer:", lowest["name"], "-", lowest["marks"])
print("\nComplete Student Report:")
for student in students:
print(student["name"], ":", student["marks"])
Probable Output
Important Concepts Used
List of dictionaries
Looping
Aggregation
Conditional comparison
Basic reporting logic
Viva Voce Questions
What is list of dictionaries?
Why use dictionary instead of tuple?
How do we calculate average?
How do we find topper?
What happens if two students have same highest marks?
Can this be extended to multiple subjects?
What is time complexity?
Procedure to Execute the Program
Open Python IDE
Create new file
Type program
Save as
.pyRun program
Enter number of students
Enter names and marks
Google Colab – Online Execution
π Paste Colab link here.
Program Explanation
Assignment for Students
Add grade classification (A, B, C)
Sort students by marks
Store data in CSV file
Add subject-wise marks
Lab Record Instructions
Right Side of the Record
1. Problem Statement
2. Python Program
Write the following neatly on the right-hand side page:
3. Flowchart
4. Algorithm
5. Output
⚠️ Students must write ALL possible outputs.
Write the following neatly on the left-hand side page:

Comments
Post a Comment