Sep-01-2018, 11:30 PM
I am in Python 2 currently running Python 2.7, and I am in desperate need of some help making a quick program that is due Sunday 9/2, any and all help would be greatly appreciated.
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.
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.
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.
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.
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.
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.