# Contact.py # Chapter 5 # Contact.py FileName.py # import Contact ModuleName is the filename without the extension # base Class name is the ModuleName class Contact # base constructor name is the class name with a tuple Contact() # if the OOP uses finalizers the finalizer name would be ~Contact ''' variables with assigned values firstName = 'Bob' lastName = 'Smith' age = 21 fullname = firstName + " " + lastName fullname = f"{firstName} {lastName}" {template variables} ''' class Contact: def __init__(self, fname, lname, age): # property = param # a property is what is being ASSIGNED<=> the value self.fname = fname self.lname = lname self.age = age # __str__ method page 56 def __str__(self): return f"Contact Information: {self.fname} {self.lname} Age: {self.age}." # the return keyword will return the value for the string to the class # Program Class # objname in memory = instance class contact1 = Contact('Bob','Smith', 21) print(contact1)