Write a program that does the following in PythonCode:
- Stores the following three lists:
last_name = [“Smith”,”Jones”, “Williams”, “Bailey”, “Rogers”, “Pyle”, “Rossington”]
first_name =[“Lisa”,”Bill”, “Jay”, “Sally”, “Walter”,”Jake”,”Gary”]
phone_number=[“240-233-1921”, “301-394-2745”, “571-321-8934”, “703-238-3432″,”703-947-9987”, “301-945-3593”, “240-671-3221”]
- Has a function named combine_lists() thattakes in last_names, first_namesand phone_numbers as lists and returns adictionary called phone_book that useslast_name as the key and a list consisting offirst_name and phone_number.
- Has a main function that iterates through thephone_book and prints out its contents. Also,prompt the user to enter a last name and print out thecorresponding contact information.
Solution
def combine_lists(last_names, first_names, phone_numbers): d = {}
OR
OR