Question: Please help me write the code to produce the outcome scenarios below. Thank you 1. A Grave is a dictionary with two keys: 'name': A

Please help me write the code to produce the outcome scenarios below. Thank you

1. A Grave is a dictionary with two keys:

'name': A string value with the grave's occupant's name

'message': A string value with the grave's message

Define a function named count_shouters that consumes a list of graves and produces an integer representing the number of graves that had their messages in all capital letters. Hint: use the .upper() method.

You are not required to document of unit test the function.

2.

A Media is a dictionary with the following keys:

"name": The name of this media

"kind": Either "movie", "song", or "game"

"duration": The length of this media in minutes

Define the function longest_kind that consumes a list of Media and produces a string value representing the kind that had the highest duration. If the list is empty, return the value None.

You are not required to document of unit test the function.

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 Databases Questions!