Question: 2 . favorite colors Create a function in your dictionary.py file called favorite _ color. It has the following specifications: It takes as input a
favorite colors
Create a function in your dictionary.py file called favoritecolor. It has the following specifications:
It takes as input a dictstr str of names and favorite colors.
It returns a str which is the color that appears most frequently.
If there is a tie for most popular color, return the color that appeared in the dictionary first.
Function name: favoritecolors
Parameter: dictstr str dictionary of names and favorite colors
Return Type: str the most popular color
An example:
favoritecolorMarc: "yellow", "Ezri": "blue", "Kris": "blue" blue
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
