Question: Write a function called find _ most _ common that takes a single dictionary parameter. Assume the keys of the dictionary will be strings (

Write a function called find_most_common that takes a single dictionary parameter. Assume the keys of the dictionary will be strings (e.g. emoticons) and each value will be a list of strings (e.g. user ID's).
i.) The function should find the key that has the longest list as a value and print out that key and the length of its list. Print in the following format:
:) occurs 871 times
NOTE: In order to get this format you must left justify the emoticon by 21 and then right justify the number by 9 if using string concatenation, one
less in
each case if passing multiple arguments to print. 'occurs' doesn't
need to be justified.
ii.) The function returns the key that had the longest list.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!