Question: 4. Write a python program that creates a dictionary whose keys are names (strings) and whose value for a key is a list of the

4. Write a python program that creates a dictionary whose keys are names (strings) and whose value for a key is a list of the favorite foods of the person with that name. Your program should prompt for and input a name and a favorite food until the user enters an empty string for the name. After creating the dictionary, the program prints one line per dictionary entry consisting of the name, the word "likes" and the favorite foods of the person with that name as show in the example below (user input underlined) Enter a sequence of names followed by a favorite food, terminating input by hitting enter for the name Name: John Food: chocolate Name: Karen Food: dates Name: John Food: merlot Name: Karen Food: sauternes Name: John Food: steak Name John likes chocolate, merlot, and steak Karen likes dates and sauternes
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
