Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

Python Mini Project

Academic Year : 2022-2026

Branch: BE (CSE)

Class:1- CSE - D

Subject: PSPP

By:
❖ Viswaa T K (TL)
❖ Vishal R
❖ Vijay Priyadharsan S
❖ Yuvaneshwaran G
Aim:
✓ To develop an application of student management
program using python

Objective:
✓ The objective of the student management program
in Python is to provide a tool for educational
institutions to manage student information, attendance,
grades, and other academic records in an organized
and efficient way. The program allows the user to add
new students, view their information, and edit their
information, and stores the data in a dictionary.By
using this program, educational institutions can keep
track of student data in a centralized location, making
it easier to manage and update student records.

✓ This can save time and effort compared to


manual record-keeping methods, and can also reduce
the risk of errors and inconsistencies in the data.The
program can also be customized to fit the specific
needs of a particular institution, by adding or
removing fields from the student data, or adding
additional functionality as needed. Overall, the
objective of the program is to improve the
management of student data and streamline
administrative tasks for educational institutions.
Features:
✓ The student management program in Python has
several features that allow educational institutions to
manage student information and academic records more
efficiently. Some of the main features of the program
include:Add a new student: This feature allows the user to
add a new student to the system by entering their name,
ID, courses taken, and grades.View a student's information:
This feature allows the user to view a student's name,
courses taken, and grades by entering their ID. If the ID is
not in the system, an error message is displayed.Edit a
student's information: This feature allows the user to edit a
student's name, courses taken, and grades by entering
their ID. If the ID is not in the system, an error message is
displayed.Store data in a dictionary: The program stores
the student data in a dictionary, allowing for easy
retrieval and manipulation of the data.Customizable: The
program can be customized to fit the specific needs of a
particular institution, by adding or removing fields from
the student data, or adding additional functionality as
needed.User-friendly interface: The program has a user-
friendly interface, with a menu-based system that makes it
easy to navigate and use.Overall, the features of the
student management program in Python make it a useful
tool for educational institutions to manage student data
and academic records in a more efficient and organized
way
Algorithm:
1. Create an empty dictionary to store student data
2. Display a menu with options for adding a new student,
viewing a student's information, editing a student's
information, or exiting the program
3. If the user selects "add a new student": a. Prompt the user
to enter the student's name, ID, courses taken, and grades b.
Create a new key-value pair in the dictionary with the ID as
the key and a dictionary of student data as the value c.
Return to the main menu
4. If the user selects "view a student's information":
a. Prompt the user to enter the student's ID
b. If the ID is in the dictionary, display the student's name,
courses taken, and grades
c. If the ID is not in the dictionary, display an error message
d. Return to the main menu
5. If the user selects "edit a student's information":
a. Prompt the user to enter the student's ID
b. If the ID is in the dictionary, display the current name,
courses taken, and grades
c. Prompt the user to enter new information for each field,
or press enter to keep the current information
d. Update the dictionary with the new information
e. Return to the main menu
6. If the user selects "exit the program", end the program
7. If the user enters an invalid choice, display an error
message and return to the main menu
Program:
def add_student():
name = input("Enter student name: ")
id = input("Enter student ID: ")
courses = input("Enter courses taken (sep
arated by commas): ").split(",")
grades = input("Enter grades (separated b
y commas): ").split(",")
students[id] = {'name': name, 'courses':
courses, 'grades': grades}

# Define a function to view a student's infor


mation
def view_student():
id = input("Enter student ID: ")
if id in students:
print("Name:", students[id]['name'])
print("Courses:", ", ".join(students[
id]['courses']))
print("Grades:", ", ".join(students[i
d]['grades']))
else:
print("Student not found")

# Define a function to edit a student's infor


mation
def edit_student():
id = input("Enter student ID: ")
if id in students:
print("Current Name:", students[id]['
name'])
name = input("Enter new name (press e
nter to keep current name): ")
if name:
students[id]['name'] = name
print("Current Courses:", ", ".join(s
tudents[id]['courses']))
courses = input("Enter new courses (s
eparated by commas, press enter to keep curre
nt courses): ")
if courses:
students[id]['courses'] = courses
.split(",")
print("Current Grades:", ", ".join(st
udents[id]['grades']))
grades = input("Enter new grades (separated
by commas, press enter to keep current grade
s): ")
if grades:
students[id]['grades'] = grades.s
plit(",")
else:
print("Student not found")

# Define a function to display the menu and h


andle user input
def main():
while True:
print("Student Management Program")
print("1. Add a new student")
print("2. View a student's informatio
n")
print("3. Edit a student's informatio
n")
print("4. Exit")
choice = input("Enter your choice: ")
if choice == "1":
add_student()
elif choice == "2":
view_student()
elif choice == "3":
edit_student()
elif choice == "4":
break
else:
print("Invalid choice")

if _name_ == "_main_":
main()
Output:
Student Management Program
1. Add a new student
2. View a student's information
3. Edit a student's information
4. Exit
Enter your choice: 1
Enter student name: John Smith
Enter student ID: 12345
Enter courses taken (separated by commas): Ma
th, English, Science
Enter grades (separated by commas): A, B, A-
Student added successfully.

Student Management Program


1. Add a new student
2. View a student's information
3. Edit a student's information
4. Exit
Enter your choice: 2
Enter student ID: 12345
Name: John Smith
Courses: Math, English, Science
Grades: A, B, A-

Student Management Program


1. Add a new student
2. View a student's information
3. Edit a student's information
4. Exit
Enter your choice: 3
Enter student ID: 12345
Current Name: John Smith
Enter new name (press enter to keep current n
ame): Jane Smith
Current Courses: Math, English, Science
Enter new courses (separated by commas, press
enter to keep current courses): Math, Englis
h, Science, History
Current Grades: A, B, A-
Enter new grades (separated by commas, press
enter to keep current grades): A, B, A-, B+
Student information updated successfully.

Student Management Program


1. Add a new student
2. View a student's information
3. Edit a student's information
4. Exit
Enter your choice: 2
Enter student ID: 12345
Name: Jane Smith
Courses: Math, English, Science, History
Grades: A, B, A-, B+

Student Management Program


1. Add a new student
2. View a student's information
3. Edit a student's information
4. Exit
Enter your choice: 4
Goodbye!
In this example, the user added a new student named John Smith
with ID 12345, three courses, and three grades. Then the user
viewed John's information, edited his name, added a course, and
changed two of his grades. Finally, the user viewed John's
information again and then exited the program.

You might also like