airports = {"DCA": "Washington, D.C.", "IAD": "Dulles", "LHR": "London-Heathrow", \
            "SVO": "Moscow", "CDA": "Chicago-Midway", "SBA": "Santa Barbara", "LAX": "Los Angeles",\
            "JFK": "New York City", "MIA": "Miami", "AUM": "Austin, Minnesota"}

# airline, number, heading to, gate, time (decimal hours)
flights = [("Southwest",145,"DCA",1,6.00),("United",31,"IAD",1,7.1),("United",302,"LHR",5,6.5),\
           ("Aeroflot",34,"SVO",5,9.00),("Southwest",146,"CDA",1,9.60), ("United",46,"LAX",5,6.5),\
           ("Southwest",23,"SBA",6,12.5),("United",2,"LAX",10,12.5),("Southwest",59,"LAX",11,14.5),\
           ("American", 1,"JFK",12,11.3),("USAirways", 8,"MIA",20,13.1),("United",2032,"MIA",21,15.1),\
           ("SpamAir",1,"AUM",42,14.4)]

print("Flights       \tDestinations        \tGate\tTime\n------------------------------------------------------")
currentFN = "A"
flights.sort()
for fn in flights:
    #if fn[0] = currentFN:
    dest = airports[fn[2]]
    dest += " "*(20-len(airports[fn[2]]))
    print(fn[0], fn[1], "\t", dest, "\t", fn[3], "\t", fn[4])

import operator
print("Flights       \tDestinations        \tGate\tTime\n------------------------------------------------------")
flights.sort(key=operator.itemgetter(4))
for fn in flights:
    dest = airports[fn[2]]
    dest += " "*(20-len(airports[fn[2]]))
    print(fn[0], fn[1], "\t", dest, "\t", fn[3], "\t", fn[4])
