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.
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.
Trending now
This is a popular solution!
Step by step
Solved in 6 steps with 4 images