<jupyter_start><jupyter_text>Example Class<jupyter_code>import datetime # we will use this for date objects

class Person:

    def __init__(self, name, surname, birthdate, address, telephone, email):
        self.name = name
        self.surname = surname
        self.birthdate = birthdate

        self.address = address
        self.telephone = telephone
        self.email = email

    def age(self):
        today = datetime.date.today()
        age = today.year - self.birthdate.year

        if today < datetime.date(today.year, self.birthdate.month, self.birthdate.day):
            age -= 1

        return age

person = Person(
    "Jane",
    "Doe",
    datetime.date(1992, 3, 12), # year, month, day
    "No. 12 Short Street, Greenville",
    "555 456 0987",
    "<EMAIL>"
)

print(person.name)
print(person.email)
print(person.age())<jupyter_output>Jane
<EMAIL>
26<jupyter_text>__init__() method is used to initialize an instance or object of a classself.name, self.surname, self.birthdate, self.address, self.telephone, and self.email are **instance** attributes You may have noticed that both of these method definitions have ```self``` as the first parameter, and we use this variable inside the method bodies – but we don’t appear to pass this parameter in. This is because whenever we call a method on an object, the object itself is automatically passed in as the first parameter. This gives us a way to access the object’s properties from inside the object’s methods.  Class attributes We define class attributes in the body of a class, at the same indentation level as method definitions (one level up from the insides of methods):<jupyter_code>class Person:

    TITLES = ('Dr', 'Mr', 'Mrs', 'Ms')   # This is a Class attribute

    def __init__(self, title, name, surname):
        if title not in self.TITLES:
            raise ValueError("%s is not a valid title." % title)

        self.title = title
        self.name = name
        self.surname = surname
        
if __name__ == "__main__":
    me = Person(title='Mr', name='John', surname='Doe')
    print(me.title)
    print(me.name)
    print(me.surname)
    print(Person.TITLES)<jupyter_output>Mr
John
Doe
('Dr', 'Mr', 'Mrs', 'Ms')