You are viewing a single comment's thread from:
RE: Payment for Coding done
Function to compare prices of multiple airlines on the same route
def compare_prices(airline_data, route):
# Filter flight data for the specified route
route_data = [flight for flight in airline_data if flight["route"] == route]
if not route_data:
return "No data available for this route."
Create a dictionary to store airline prices
Populate the airline_prices dictionary
Calculate the average price for each airline