

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


This project is a simple Student Management System written in Python. It allows users to add, search, delete, and display student records stored in a text file. The project is suitable for beginners learning file handling and basic Python concepts.
def add_student(): name = input('Enter student name: ') roll = input('Enter roll number: ') with open('students.txt', 'a') as f: f.write(f'{roll},{name}\n') def display_students(): with open('students.txt', 'r') as f: for line in f: roll, name = line.strip().split(',') print(f'Roll: {roll}, Name: {name}') def search_student(): roll_search = input('Enter roll number to search: ') found = False with open('students.txt', 'r') as f: for line in f: roll, name = line.strip().split(',')
if roll == roll_search: print(f'Student Found - Roll: {roll}, Name: {name}') found = True break if not found: print('Student not found.')
The system stores student data in a text file named 'students.txt'. Each line contains the roll number and name of a student. The program provides options to add new students, display all students, and search a student by their roll number.
This project provides a foundation for understanding file handling and basic operations in Python. It can be extended into more complex applications and serves as a great starting point for new programmers.