Python Assignment

  airports = [{‘name’: ‘Cincinnati’, ‘altitude’: 2000, ‘code’: ‘CVG’}, {‘name’: ‘Chicago’, ‘altitude’: 1800, ‘code’: ‘OHA’}, {‘name’: ‘Indianapolis’, ‘altitude’: 1700, ‘code’: ‘INY’}]

1. Given the “airports” list above, create 3 lists, one of the airport names, one of the airport altitudes and one of airport codes using for loops… using list comprehensions…using another technique

2. Given the 3 lists from #1, combine them back into a list of dictionaries using the most efficient technique you can think of

3. Given the “airports” list above, find the total combined altitude using for loops… using the sum() function… using the reduce() function.

PLEASE PROVIDE PYTHON 2.X/3.X CODE FOR SOLVING THE EXERCISES ABOVE.

Tags: No tags