Question: This is in Python The test list is here, since it goes off the screen. 2 different test examples result = get_highest_density(((CHN, China, 1339190000, 9596960),

This is in Python
The test list is here, since it goes off the screen. 2 different test examples
result = get_highest_density((("CHN", "China", 1339190000, 9596960), ("NZL", "New Zealand", 4383600, 268680), ("USA", "United States of America", 309975000, 9629091),("GBR", "Great Britain", 62041708, 244820), ("MCO", "Monaco", 33000, 2), ("MNG", "Mongolia", 2768800, 1565000))) print(result)
-----------------------
countries = (("CHN", "China", 1339190000, 9596960),) result = get_highest_density(countries) print(result)
Write a function called get_highest_density(countries) that takes a list of tuples as a parameter. Each item in the list is a tuple containning a 3-letter international country code, country name, population density and the area. The function should return the tuple with the highest population density. For example, the countries list contains the following tuples: For example: Test result = get_highest_density((("CHN", "China", 1339190000, 9596960), ("NZL", "New Zealand", 4383600, 268680), ("USA", "United States of Am print(result) countries = (("CHN", "China", 1339190000, 9596960), ) result = get_highest_density(countries) print (result)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
