Repository navigation
Expand file tree
/
Copy pathstudentgrademanagment.py
More file actions
81 lines (63 loc) · 1.95 KB
/
Copy pathstudentgrademanagment.py
File metadata and controls
81 lines (63 loc) · 1.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# Student Grade Management System
students = {}
while True:
print("\n===== STUDENT GRADE MANAGEMENT SYSTEM =====")
print("1 - Add Student")
print("2 - Update Student")
print("3 - Delete Student")
print("4 - View Students")
print("5 - Exit")
choice = input("Enter choice: ")
# Add Student
if choice == "1":
name = input("Enter student name: ")
marks = int(input("Enter marks: "))
if marks >= 90:
grade = "A"
elif marks >= 75:
grade = "B"
elif marks >= 50:
grade = "C"
else:
grade = "Fail"
students[name] = grade
print("Student added successfully!")
# Update Student
elif choice == "2":
name = input("Enter student name to update: ")
if name in students:
marks = int(input("Enter new marks: "))
if marks >= 90:
grade = "A"
elif marks >= 75:
grade = "B"
elif marks >= 50:
grade = "C"
else:
grade = "Fail"
students[name] = grade
print("Student updated successfully!")
else:
print("Student not found!")
# Delete Student
elif choice == "3":
name = input("Enter student name to delete: ")
if name in students:
del students[name]
print("Student deleted successfully!")
else:
print("Student not found!")
# View Students
elif choice == "4":
print("\nStudent Records")
if len(students) == 0:
print("No records found!")
else:
for name, grade in students.items():
print(name, ":", grade)
# Exit
elif choice == "5":
print("Program Ended")
break
else:
print("Invalid Choice")