Question: Python 2.7 This needs to be in python 2.7 We're going to write a program that manages the email address of our contacts. Your program
Python 2.7
This needs to be in python 2.7
We're going to write a program that manages the email address of our contacts. Your program must contain a class named contact that has 3 attributes (instance variables): last name, first name, and email. Your class should also have a method to return the name and email address for printing when requested. You may add other methods to the class if you like.
Please start early in the week that this program is due; this gives you plenty of time to ponder how is should work. Moreover, there will be more to ponder as the course progresses. I am glad to help troubleshoot programs, but I go to bed reasonably early and am unlikely to stay up until midnight of the due date.
Each contact should use a single instance of your contact class. You should use either a list or a dictionary to act as a container of the contact instances.
Also, the program should have a menu that allows the user to interact with your collection of contacts: displaying contacts or adding new contacts as long as the user wishes, then saying goodbye when finished. The menu should offer these options.
Program Options. 1.) Display all contacts 2.) Create new contact 3.) Exit option = raw_input("Enter 1, 2, or 3: ")
There are several examples of this kind of menu program scattered throughout the lecture notes for the first several weeks of the semester. The example most relevant to this assignment comes as the end of the notes on Classes.
For full credit.
use a python class to represent the contact info and at least one method to print that info.
collect each new contact instance in a list or dictionary.
please format printed output.
Optionally, you might save and retrieve the dictionary or list of instances to/from disk using the pickle module. This is not a program requirement. If your program just collects and prints the contacts you get full credit. But if you do save the collection of classes, and everything works, I'll add a bonus of 20 points.
Here is a possible print-out, where we display some pre-existing contacts, add a new contact, then re-display the list to see that our contact has been added. Again, you do not need to save before exiting.
If you get good and stuck attach a compressed version of your code (or paste it into the body of an email) and mail it to me; I'll be glad to help you troubleshoot it.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
