nick34992
5/3/2017 - 6:18 PM

Python: Class: __init__, super()

Python: Class: init, super()

class Contact:
    all_contacts = []

    def __init__(self, name, email):
        self.name = name
        self.email = email
        Contact.all_contacts.append(self)

class Friend(Contact):
    def __init__(self, name, email, phone):
        super().__init__(name, email)
        self.phone = phone