Question
Please help to write this in Python with TDD. Write a program that will read a file with airport codes. For example, the file may
Please help to write this in Python with TDD. Write a program that will read a file with airport codes.
For example, the file may contain: IAH IAD SFO STL BOS MSP
For each given airport code, the program will fetch the airport name, the city name, state name, temperature, and if there is a delay or not, from http://services.faa.gov/airport/status/{CODE}?format=application/json [replace {CODE} with an airport code,
for example http://services.faa.gov/airport/status/IAH?format=application/json to get data for the airport code IAH] The program will print, in sorted order of city name (if two cities have the same name, then the data is further sorted on state name), the following details: city | state | airport code | airport name | temperature | delayed or --- (--- for no delay).
The program will also print, below the table, one line Number of airport delays: # (where # is the actual number of delays). If for some reason the details for a airport could not be obtained, then the row for that should be shown with --- for all data that could not be obtained for that airport code (but the airport code itself will be displayed on the row).
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started