Question: Python program. Need it quick please. A smart phone has the ability to save contact information. In this assignment, you will simulate the contact list
Python program. Need it quick please.
A smart phone has the ability to save contact information. In this assignment, you will simulate the contact list for a very simple smart phone. Download lab8.py, rename it according to the instructions above, and make sure you understand it. Take the program above and modify it by adding the missing Contact class such that when the program is run, it produces this output.
#lab8.py
# ----------------------------------------------------- # CSCI 127, Lab 8 # October 24, 2017 # Your Name # ----------------------------------------------------- # ----------------------------------------------------- # Do not change anything below this line # ----------------------------------------------------- def print_directory(contacts): print("My Contacts") print("-----------") for person in contacts: print(person) print("----------- ") # ----------------------------------------------------- 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()
Ouput
My Contacts ----------- ??? Bobcat 406-994-0000 Waded Cruzado 406-994-CATS John Paxton 406-994-4780 ----------- My Contacts ----------- Champ Bobcat 406-994-0000 President Waded Cruzado 406-994-CATS Professor John Paxton 406-994-4780 ----------- The area code for cell number 406-994-0000 is 406
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
