Question: Please use dictionaries and tuples in the code. The attached file airfares.txt contains the records of airfares posted by an airline for flights between

Please use dictionaries and tuples in the code. The attached file "airfares.txt" contains the records of airfares posted by an airline for flights
between Canadian cities. Each record is placed on a separate line, and consists of comma
separated fields containing (from left to right) the date/time of the flight, the origin city, the
destination city, and the airfare. Given the file "airfares.txt", write a program called
airfares_analysis.py to find and display for each Canadian city the highest fare of departing
flights and corresponding destinations. Cities of departing flights must be listed in alphabetic
order as illustrated by the expected output of the program for the provided file, given below:Charlottetown : $486.85['Regina']
Edmonton : $500.24['Quebec City']
Fredericton : $499.21['Vancouver']
Halifax : $485.32['Ottawa', 'Whitehorse']
Iqaluit : $498.57['Edmonton']
London : $457.29['Edmonton']
Montreal : $499.63['Yellowknife']
Ottawa : $493.13['Victoria']
Quebec City : $499.21['Ottawa', 'Winnipeg']
Regina : $469.3['Windsor']
St John's : $495.38['Quebec City']
Toronto : $497.1['Edmonton']
Vancouver : $494.87['Montreal']
Victoria : $494.88['Vancouver']
Whitehorse : $496.88['Calgary']
Windsor : $486.19['Halifax']
Winnipeg : $498.28['Yellowknife']
Yellowknife : $494.67['Charlottetown']
 Please use dictionaries and tuples in the code. The attached file

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!