-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDay_9_StudentResultSystem.py
More file actions
37 lines (35 loc) · 995 Bytes
/
Copy pathDay_9_StudentResultSystem.py
File metadata and controls
37 lines (35 loc) · 995 Bytes
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
students=[]
def add_student():
student={"name":input("Enter student name: "),
"marks":int(input("Enter student marks: "))}
students.append(student)
def show_students():
for student in students:
print(f"Name: {student['name']}")
def topper():
top=0
for student in students:
if student["marks"]>top:
top=student["marks"]
for student in students:
if student["marks"]==top:
print(f"Name: {student['name']}")
def main():
while True:
print("1. Add Student")
print("2. Show Students")
print("3. Topper")
print("4. Exit")
choice = input("Enter your choice: ")
if choice == "1":
add_student()
elif choice == "2":
show_students()
elif choice == "3":
topper()
elif choice == "4":
break
else:
print("Invalid choice. Please try again.")
if __name__ == "__main__":
main()