Hi
I'm trying remove a person from a list but it's not working.
How can I make it work, please help me.
def RemoveName(self ):
lastname = raw_input("Ente r the last name of the person you want to remove ")
for i in list_1:
if lastname == i.lastname:
list_1.remove(i )
print "Removed", i.name, i.lastname
return
else:
print "The name doesn't exist."
I'm trying remove a person from a list but it's not working.
How can I make it work, please help me.
def RemoveName(self ):
lastname = raw_input("Ente r the last name of the person you want to remove ")
for i in list_1:
if lastname == i.lastname:
list_1.remove(i )
print "Removed", i.name, i.lastname
return
else:
print "The name doesn't exist."
Comment