The Knowledge
Habitat, Pune
Class XII
COMPUTER SCIENCE
Code: (083)
PROJECT REPORT
(Session : 2025-26)
Submitted By: Submitted To:
Student Name: Kush Agarwal Mrs. Shruti Garg
Roll No. : 21 PGT Computer Science
Class and Section : XII A
TABLE OF CONTENTS
[Link] Topic Name Page
.no
1) CERTIFICATE. 1
2) ACKNOWLEDGEMENT 2
3) INTRODUCTION TO THE 3
PROJECT.
4) OBJECTIVES 4
5) SYSTEM REQUIREMENTS. 5
6) PROJECT DESCRIPTION 6
7) PROGRAM CODE (INPUT) 7
8) SCREENSHOTS & OUTPUT 15
9) CONCLUSIONS 24
10) BIBLIOGRAPHY. 25
ACKNOWLEDGEMENT
We express our heartfelt gratitude to our Computer Science mentors at *The
Knowledge Habitat, Pune*, whose constant guidance, insightful explanations, and
encouragement made this project possible. Developing a fully functional software
system is both complex and intellectually enriching, requiring patience, technical
clarity, and persistent effort throughout the design and implementation stages.
I would like to express my sincere gratitude to my Computer Science teacher for
providing me with the opportunity to work on this project titled “Student Marks
and Attendance Management System”. Their valuable guidance, encouragement,
and continuous support helped me understand the concepts of Python programming
and file handling effectively.
I am also thankful to my school for providing the necessary resources and a
conducive learning environment to complete this project successfully. I would like
to acknowledge the support of my classmates and friends for their helpful
suggestions and cooperation during the development of this project.
Finally, I would like to thank my parents for their constant motivation and support
throughout the completion of this project.
INTRODUCTION
In today’s digital age, computers play an important role in managing and organizing
data efficiently. In schools, maintaining student academic records such as marks,
attendance, and performance analysis is an essential task. Manual record-keeping is
time-consuming, error-prone, and difficult to manage as the number of students
increases.
This project titled “Student Marks and Attendance Management System” is
developed using the Python programming language and CSV file handling. The
main objective of this project is to provide a simple, menu-driven system that
allows users to store, update, delete, search, and analyze student academic records
in an organized manner.
The system stores details such as student roll number, name, subject-wise marks,
total marks, percentage, result (Pass/Fail), and attendance. The roll number is
treated as a primary key, ensuring that each student record is unique. All data is
stored permanently in a CSV file, making the system reliable and easy to access
even after the program is closed.
This project helps in understanding important programming concepts such as
functions, conditional statements, loops, file handling, data validation, and error
handling. It also demonstrates how Python can be used to develop real-world
applications for educational institutions.
OBJECTIVES
The Student Marks Management System has been developed with the goal of
creating a structured, user-friendly, and efficient platform for managing
Marksrelated workflows. Following are the key objectives of the project:
1. To develop a menu-driven application using Python that can manage student academic
records efficiently.
2. To store student details permanently using CSV file handling, so that data is not lost
after the program is closed.
3. To maintain subject-wise marks for each student and automatically calculate total
marks, percentage, and result (Pass/Fail).
4. To treat roll number as a primary key, ensuring that each student record is unique and
preventing duplicate entries.
5. To provide facilities for updating and deleting records, allowing correction of data
when required.
6. To enable searching of student records quickly using roll number.
7. To display present and absent students separately, helping in attendance management.
8. To analyze class performance by calculating subject-wise aggregate marks, average
percentage, topper details, and class summary.
9. To implement proper input validation and error handling, making the program user-
friendly and crash-free.
[Link] understand and apply core programming concepts such as functions, loops,
conditional statements, file handling, and data validation in Python.
SYSTEM REQUIREMENTS
1. Programming Language
• Python
Python is used as the main programming language for this project. It is
simple, easy to understand, and supports powerful features such as file
handling, functions, and data validation, making it suitable for developing this
application.
2. File Handling Technique
• CSV (Comma Separated Values) File Handling
The project uses CSV files to store student records permanently. CSV files are
lightweight, easy to read, and can be opened using spreadsheet software like
Microsoft Excel, making data management simple and efficient.
3. Python Modules
• csv module
The built-in csv module is used to read from and write data into the CSV file.
It helps in handling structured data efficiently.
4. Development Environment
Python IDLE / VS Code / Any Python Editor
The program can be written and executed using Python IDLE or any standard code
editor that supports Python.
5. Operating System
• Windows / Linux / macOS
The program is platform-independent and can run on any operating system
that supports Python.
PROJECT DESCRIPTION
The Student Marks and Attendance Management System is a Python-based, menu-driven
application designed to efficiently manage student academic records using CSV file
handling. The system provides a structured way to store, retrieve, update, delete, and analyze
student data in a simple and user-friendly manner.
The project maintains important student information such as roll number, name, subject-wise
marks in English, Mathematics, Physics, Chemistry, and Computer Science, total marks,
percentage, result (Pass/Fail), and attendance status. The roll number is treated as a primary
key, ensuring that each student record is unique and preventing duplication of data.
The system allows users to perform multiple operations through a menu interface, including
adding new records, displaying all records with proper column headings, viewing present
and absent students separately, searching for a student by roll number, updating existing
records, and deleting records when required. It also provides analytical features such as
subject-wise aggregate marks, average percentage of the class, topper details, and a class
summary showing highest and lowest scorers.
All records are stored permanently in a CSV file, making the system reliable and persistent
even after the program is closed. This project demonstrates the practical application of
Python programming concepts such as functions, loops, conditional statements, file
handling, data validation, and error handling, making it suitable for real-world educational
record management.
PROGRAM CODE (INPUT)
• For the code to work, an excel file has to be created with the respective name.
# ================= CALCULATIONS =================
def calculate_result(marks):
total = sum(marks)
percentage = (total / 500) * 100
result = "PASS" if all(m >= 33 for m in marks) and percentage >= 33 else "FAIL"
return total, round(percentage, 2), result
# ================= DISPLAY TABLE =================
def display_table(row):
if len(row) != 11:
print("Corrupted record found. Skipping display.")
return
print("\nRoll Name Eng Math Phy Chem CS Total % Result Att")
print("------------------------------------------------------------")
print(*row)
# ================= MENU =================
def menu():
print("\n--- STUDENT MANAGEMENT SYSTEM ---")
print("1. Add Record")
print("2. Display All Records")
print("3. Display Present Students")
print("4. Display Absent Students")
print("5. Search Record")
print("6. Subject-wise Aggregate & Average Percentage")
print("7. Topper Details")
print("8. Update Record")
print("9. Delete Record")
print("10. Class Summary")
print("11. Exit")
# ================= ADD RECORD =================
def add_record():
roll = input("Enter Roll Number: ")
if roll_exists(roll):
print("❌ Roll number already exists.")
return
name = input("Enter Name: ")
marks = [
get_valid_marks("English"),
get_valid_marks("Maths"),
get_valid_marks("Physics"),
get_valid_marks("Chemistry"),
get_valid_marks("Computer Science")
]
total, percentage, result = calculate_result(marks)
while True:
attendance = input("Enter Attendance (P/A): ").upper()
if attendance in ("P", "A"):
break
print("Invalid input. Enter P or A only.")
row = [roll, name] + marks + [total, percentage, result, attendance]
with open(FILENAME, "a", newline="") as f:
[Link](f).writerow(row)
print("\nRecord added successfully!")
display_table(row)
# ================= DISPLAY ALL =================
def display_all():
try:
found = False
with open(FILENAME, "r") as f:
reader = [Link](f)
print_header()
for row in reader:
if len(row) == 11:
print(*row)
found = True
if not found:
print("No records found.")
except FileNotFoundError:
print("File not found.")
# ================= PRESENT =================
def display_present():
try:
found = False
with open(FILENAME, "r") as f:
reader = [Link](f)
print_header()
for row in reader:
if len(row) == 11 and row[10] == 'P':
print(*row)
found = True
if not found:
print("No students are present.")
except FileNotFoundError:
print("File not found.")
# ================= ABSENT =================
def display_absent():
try:
found = False
with open(FILENAME, "r") as f:
reader = [Link](f)
print_header()
for row in reader:
if len(row) == 11 and row[10] == 'A':
print(*row)
found = True
if not found:
print("No students are absent.")
except FileNotFoundError:
print("File not found.")
# ================= SEARCH =================
def search_record():
roll = input("Enter Roll Number to search: ")
try:
with open(FILENAME, "r") as f:
for row in [Link](f):
if len(row) > 0 and row[0] == roll:
display_table(row)
return
print("Record not found.")
except FileNotFoundError:
print("File not found.")
# ================= SUBJECT AGGREGATE & AVG % =================
def subject_aggregate_and_avg_percentage():
try:
eng = math = phy = chem = cs = 0
percent_total = count = 0
with open(FILENAME, "r") as f:
for row in [Link](f):
if len(row) == 11:
eng += int(row[2])
math += int(row[3])
phy += int(row[4])
chem += int(row[5])
cs += int(row[6])
percent_total += float(row[8])
count += 1
if count == 0:
print("No records available.")
return
print("\n--- SUBJECT-WISE AGGREGATE MARKS ---")
print("English:", eng)
print("Maths:", math)
print("Physics:", phy)
print("Chemistry:", chem)
print("Computer Science:", cs)
print("\nAverage Percentage of Class:", round(percent_total / count, 2), "%")
except FileNotFoundError:
print("File not found.")
# ================= TOPPER =================
def topper():
try:
high = -1
name = ""
with open(FILENAME, "r") as f:
for row in [Link](f):
if len(row) == 11 and int(row[7]) > high:
high = int(row[7])
name = row[1]
if high != -1:
print("Topper:", name, "| Marks:", high)
else:
print("No records.")
except FileNotFoundError:
print("File not found.")
# ================= UPDATE =================
def update_record():
roll = input("Enter Roll Number to update: ")
if not roll_exists(roll):
print("❌ Roll number not found.")
return
rows = []
updated = False
with open(FILENAME, "r") as f:
for row in [Link](f):
if len(row) == 11 and row[0] == roll:
new_name = input("Enter new name: ")
marks = [
get_valid_marks("English"),
get_valid_marks("Maths"),
get_valid_marks("Physics"),
get_valid_marks("Chemistry"),
get_valid_marks("Computer Science")
]
total, percentage, result = calculate_result(marks)
attendance = input("Enter Attendance (P/A): ").upper()
row = [roll, new_name] + marks + [total, percentage, result, attendance]
updated = True
print("\nUpdated Record:")
display_table(row)
[Link](row)
if updated:
with open(FILENAME, "w", newline="") as f:
[Link](f).writerows(rows)
print("✅ Record updated successfully.")
else:
print("❌ Update failed.")
# ================= DELETE =================
def delete_record():
roll = input("Enter Roll Number to delete: ")
rows = []
deleted = False
try:
with open(FILENAME, "r") as f:
for row in [Link](f):
if len(row) == 11 and row[0] == roll:
deleted = True
else:
[Link](row)
with open(FILENAME, "w", newline="") as f:
[Link](f).writerows(rows)
if deleted:
print("Record deleted successfully.")
else:
print("Record not found.")
except FileNotFoundError:
print("File not found.")
# ================= CLASS SUMMARY =================
def class_summary():
try:
records = {}
with open(FILENAME, "r") as f:
for row in [Link](f):
if len(row) == 11:
records[row[0]] = row
if not records:
print("No records.")
return
total_marks = 0
highest = -1
lowest = 501
high_name = low_name = ""
for row in [Link]():
marks = int(row[7])
name = row[1]
total_marks += marks
if marks > highest:
highest = marks
high_name = name
if marks < lowest:
lowest = marks
low_name = name
count = len(records)
print("\n--- CLASS SUMMARY ---")
print("Total Students:", count)
print("Average Marks:", round(total_marks / count, 2))
print("Highest Marks:", highest, f"(Student: {high_name})")
print("Lowest Marks:", lowest, f"(Student: {low_name})")
except FileNotFoundError:
print("File not found.")
# ================= MAIN =================
show_intro()
while True:
menu()
try:
choice = int(input("Enter your choice: "))
except ValueError:
print("Enter a valid number.")
continue
if choice == 1:
add_record()
elif choice == 2:
display_all()
elif choice == 3:
display_present()
elif choice == 4:
display_absent()
elif choice == 5:
search_record()
elif choice == 6:
subject_aggregate_and_avg_percentage()
elif choice == 7:
topper()
elif choice == 8:
update_record()
elif choice == 9:
delete_record()
elif choice == 10:
class_summary()
elif choice == 11:
print("Exiting program...")
break
else:
print("Invalid choice.")
continue
if not return_to_menu():
break
SCREENSHOTS & OUTPUT
For OUTPUT:-
1. Adding a record:
2. Displaying Records:
3. Display Present Records:
4. Display Absent Students:
5. Search Records:
6. Subject- Wise Aggregate:
7. Topper Details:
8. Update Record:
9. Delete a record:
10. Class Summary:
11. Exit:
CSV File Screenshot:-
1) Before the code runs:
2) After the code runs:
CONCLUSION
The Student Marks and Attendance Management System successfully
fulfills its objective of managing student academic records in an efficient
and organized manner. The project demonstrates how Python can be
effectively used along with CSV file handling to store, update, delete, and
analyze student data.
Through this project, various important programming concepts such as file
handling, functions, loops, conditional statements, data validation, and
error handling have been implemented practically. The system ensures
data accuracy by treating the roll number as a primary key and provides
useful features like subject-wise aggregate marks, average percentage,
topper details, and class summary.
This project reduces manual effort, minimizes errors, and provides a user-
friendly approach to handling student records. It is suitable for real-world
school environments and serves as a strong foundation for developing
more advanced database-driven applications in the future.
BIBLIOGRAPHY
1. Python Software Foundation
Python Official Documentation
[Link]
2. GeeksforGeeks
Python CSV File Handling
[Link]
3. W3Schools
Python File Handling and CSV Files
[Link]
4. NCERT Computer Science
Textbook
Prescribed textbook for understanding Python
programming concepts.
5. Class Notes and Teacher Guidance
Reference material provided during
classroom instruction.