Write a program that does the following in Python Code:
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"]
def combine_lists(last_names, first_names, phone_numbers): phone_book = {} for i in range(len(last_names)): phone_book[last_names[i]] = [first_names[i], phone_numbers[i]] return phone_book def main(): 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"] phone_book = combine_lists(last_name, first_name, phone_number) for l_name, value in phone_book.items(): print(value[0] + " " + l_name + ", Number: " + value[1]) last = input("Enter a last name: ") if last in phone_book: print("Number of " + last + " is " + phone_book[last][0]) main()
Write a program that does the following in Python Code: Stores the following three lists: last_...
Write a program that does the following in Python Code: 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() that takes in last_names, first_names and phone_numbers as lists and returns a dictionary called phone_book that uses last_name as the key and a list consisting of first_name and phone_number. Has a main function that iterates through the...