Session 6: OOP & Debugging
Week 4 approach (functions + dictionaries):
contacts = []
def add_contact(contacts_list, name, phone):
pass
def search_contacts(contacts_list, term):
pass
Week 6 approach (OOP):
class ContactManager:
def __init__(self):
self.contacts = []
def add_contact(self, name, phone):
pass
def search(self, term):
pass
The data and the functions that operate on it are now together!