Question: programming language python check for test case Write a class Contacts for a contacts book, with the following attributes (make sure the attributes are private
Write a class Contacts for a contacts book, with the following attributes (make sure the attributes are private using name mangling): owner: String names : List of Strings -- names in the contacts book emails: List of Strings -- emails of the contacts The class must include the following operations: A constructor that receives as input the owner. Getters for each attribe. new_contact(name: String, email: String): Bool This operation adds the person's name to the list of names and the email to the list of emails. The method must check whether the email contains the '@' character, if it does not then the contact (name and email) won't be added. The method must return True if the new contact was added, False otherwise. _str_0 -- Should return the following information "cowner> is the owner of this notebook, which has
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
