I have to create a program that will ask user to input details of a student including their ID number (which is to be saved to a global list). Then the user will be returned to the main menu where they are asked to view add or delete.
I can do the adding a student, I have done view , I have created the class etc… but I cannot get it to delete. We have to delete a student we have added by entering their ID number and then after deletion the program must confirm who it has deleted.
def removeStudent():
std_delete = raw_input("Please enter Students ID number to remove: ")
for std in students:
if std.studentID == std_delete:
print "Student ID",std_delete,"has been deleted" % std.studentID
students.remove(std)
break
I think you are confuse how to delete a student instance
or you may using filter function