There are a lot of popular destinations that our customers will want to go to that don't have direct flights. e.g. Bali

1. If a flight is not found, check to see if there are flights with 1 stop and pretty print the result with pprint().

2. Modify the FlightData class to add 2 optional init parameters with default values - stop_overs=0 and via_city="" . Instead of the printing the result from (1.) above, create a flight object with stop_overs set to 1 and via_city as the name of stopover city. Examine the data you printed in (1.) carefully to extract the information for origin_city, origin_airport, destination_city, destination_airport, out_date, and return_date .

HINT: the "route" key value pair you get back from the API now contains a list with 4 items. [origin -> stop_over, stop_over -> destination, destination -> stop_over, stop_over -> origin].

3. Format the message to the NotificationManager in main.py to add the stop_over number and via_city, if a flight is found that requires a stopover.

e.g. It should read:


SOLUTION


STEP 4 SOLUTION in REPL.IT