I am writing a program that allows the user to input student records, view records, delete records and display averages of marks. I am having trouble with removing a user inputted name from the list along with the students marks. This is the code i have so far
studentlist=[]
a=1
while a!=0:
print ("""
1. Add new student records
2. Show all student records
3. Delete a student record
4. Dislay overall average coursework mark
5. Display overall average exam mark
6. Calculate average marks
0. Exit
Plese select an option
""")
a=int(input(""))
if a==1:
name=input("Enter a students name: ")
cmark=int(input("Enter the students coursework mark: "))
emark=int(input("Enter the students exam mark: "))
student=(name,cmark,emark)
print (student)
studentlist.append(student)
student=()
if a==2:
for n in studentlist:
print ("Name:", n[0])
print ("Courswork mark:",n[1])
print ("Exam mark:", n[2])
print ("")
if a==3:
name=input("Enter a students name: ")
for n in studentlist:
if n[0]==name:
studentlist.remove(n[0])
studentlist.remove(n[1])
studentlist.remove(n[2])