The text file airports.txt1 contains information on all airports of the US. The information of each airport is on a separate line and consists of the following five fields of information that are separated by a tab:

The first line of the file is a header that contains the names of the different columns.

Assignment

Example

In the following interactive Python session we assume that the file airports.txt3 is located in the current directory.

>>> airports = readairports('airports.txt')
>>> airports
{'AGN': (57.83, 134.97, 'Angoon', 'AK'), ...}
>>> airports['ADK']    
(51.88, 176.65, 'Adak', 'AK')
>>> airports['DCA']    
(38.85, 77.04, 'Washington/Natl', 'DC')
>>> airports['4OM']
(48.42, 119.53, 'Omak', 'WA')
>>> distance('P60', 'MSN', airports)
1694.54554995
>>> distance('ADK', 'DCA', airports)
7295.50355678
>>> stopover('ADK', 'DCA', airports, 4000)
'4OM'