I was given the code that begins with the print_directory function and told not to alter anything below that. I've created the contact class above. Why am I receiving the attribute error, and how would I fix it? I'm trying to create a class that uses the variables in the main function to return the first name, last name, and phone numbers of the contacts list.
My code is below:
class Contact:
    fname = ""
    lname = ""
    p_number = ""
    
    def __init__(self,fname,lname,p_number):
        self.fname = fname
        self.lname = lname
        self.p_number = p_number
        
    def getfname(self):
        return self.fname
    
    def getlname(self):
        return self.lname
    
    def getp_number(self):
        return self.p_number
def print_directory(contacts):
    print("My Contacts")
    print("-----------")
    for person in contacts:
        person.print_entry()
    print("-----------\n")
# -----------------------------------------------------
def main():
    champ = Contact("???", "Bobcat", "406-994-0000")
    president = Contact("Waded", "Cruzado", "406-994-CATS")
    professor = Contact("John", "Paxton", "406-994-4780")
    contacts = [champ, president, professor]
    print_directory(contacts)
    champ.set_first_name("Champ")
    president.set_title("President")
    professor.set_title("Professor")
    print_directory(contacts)
    print("The area code for cell number", champ.get_cell_number(), "is", \
           champ.get_area_code())
# -----------------------------------------------------
main()