class BirthdayEntry(): def __init__(self, given_name = None, family_name = None, email_address = None, DOB = None): self.given_name = given_name self.family_name = family_name self.email_address = email_address self.DOB = DOB def display(self): print('{} {}: {} {}'.format(self.given_name, self.family_name, self.email_address, self.DOB)) class BirthdayBook(): def __init__(self): self.friends = [] def add_newentry(self, new_entry): self.friends.append(new_entry) def display(self): for friend in self.friends: friend.display() class UserInterface(): def __init__(self,book): self.birthday_book=book self.choices() def add_entry(self): print ("Adding a new person") given_name = input("Given Name? ") family_name = input("Family Name? ") email_address = input("Email address? ") DOB_PROMPT = "Date of Birth in form DD MM YY? " DOB = input(DOB_PROMPT) birthday_entry = BirthdayEntry(given_name, family_name, email_address, DOB) self.birthday_book.add_newentry(birthday_entry) def choices(self): print("""An OOP Birthday Book Python program Use: a to add an entry d to display all save entries in Address Book i to see the instructions q to quit """) while True: choice = input("Make a selection from the above ") if choice=="a": self.add_entry() elif choice=="i": print("Students devise Instruction menu") elif choice =="d": self.display_summaries() def display_summaries(self): self.birthday_book.display() book = BirthdayBook() book.add_newentry(BirthdayEntry('Bob', 'Smith', 'bsmith@python.com', '11111')) book.add_newentry(BirthdayEntry('Mary', 'Smith', 'msmith@python.com', '22222')) UserInterface(book)