Dec-17-2018, 12:34 PM
Here is a part of a code i found online while i am trying to get familiar with oop:
class ContactList(list): def search(self, name): """Return all contacts that contain the search value in their name.""" matching_contacts = [] for contact in self: if name in contact.name: matching_contacts.append(contact) return matching_contactscan you explain me the for loop please(
Quote: for contact in self:),how does it go?