Hi
I wanted to know how can I delete class object inside list.
class Record:
def __init__(self):
self.list = []
def add(self):
fname = raw_input("First Name:> ")
lname = raw_input("Last Name:> ")
street = raw_input("Street:> ")
self.list.append( Person( fname, lname, street))
Now I have added my Person object into the record list.
My question is how can i delete Person object in the list depending on the person.name
def delete(self):
fname = raw_input("First Name:> ")
for item in self.list:
if (item.name == fname):
del ???????????????
Help me out.
Thanks .