Page 1 of 1

flightsD={"Delta":{1102:[["IND",1850],["MDW",1955]], 1096:[["PHX",900],["MDW",1255]], 1445:[["ATL",1135],["LAX",1810]],

Posted: Sat May 14, 2022 7:18 pm
by answerhappygod
flightsD={"Delta":{1102:[["IND",1850],["MDW",1955]],
1096:[["PHX",900],["MDW",1255]],
1445:[["ATL",1135],["LAX",1810]],
1776:[["PHL",1350],["RAP",1610]],
1226:[["PHX",950],["MDW",1345]],
1885:[["ATL",1305],["LAX",2000]],
1009:[["MDW",1850],["IND",1955]],
9001:[["MDW",2145],["IND",2255]]},
"Southwestern":{1111:[["SAT",430],["MDW",825]],
2121:[["MDW",430],["SAT",825]],
4335:[["PHX",450],["MDW",745]],
1102:[["MDW",1100],["PHX",1450]]},
"American":{7765:[["IND",1850],["CHA",2105]],
2133:[["BNA",900],["IND",1115]],
3321:[["HOU",1337],["ATL",1615]],
2100:[["BNA",900],["IND",1115]],
4311:[["HOU",905],["ATL",1255]],
5577:[["ATL",1100],["HOU",1351]],
1102:[["BNA",1100],["HOU",1450]]}}
L12-6 Write a function def printAirlinesFlightInfo(airD): that
will
print out the names of all of the airlines along with the flight
numbers,
departure city and time, and arrival city and time for all flights
for
that airline. Be sure the time is formatted in civilian time (am or
pm)
def milToCivil(tm):
def printAirlinesFlightInfo(airD):
Needed Output:
Delta 1102 IND 6:50pm MDW 7:55pm
Delta 1096 PHX 9:00am MDW 12:55pm
Delta 1445 ATL 11:35am LAX 6:10pm
Delta 1776 PHL 1:50pm RAP 4:10pm
Delta 1226 PHX 9:50am MDW 1:45pm
Delta 1885 ATL 1:05pm LAX 8:00pm
Delta 1009 MDW 6:50pm IND 7:55pm
Delta 9001 MDW 9:45pm IND 10:55pm
Southwestern 1111 SAT 4:30am MDW 8:25am
Southwestern 2121 MDW 4:30am SAT 8:25am
Southwestern 4335 PHX 4:50am MDW 7:45am
Southwestern 1102 MDW 11:00am PHX 2:50pm
American 7765 IND 6:50pm CHA 9:05pm
American 2133 BNA 9:00am IND 11:15am
American 3321 HOU 1:37pm ATL 4:15pm
American 2100 BNA 9:00am IND 11:15am
American 4311 HOU 9:05am ATL 12:55pm
American 5577 ATL 11:00am HOU 1:51pm
American 1102 BNA 11:00am HOU 2:50pm
L12-7 Write a function def
printSelectedFlight(airD,airline,flightNum):
that will print out the departure city and time, and arrival city
and time
for the specified flight for the specified airline. Be sure the
time is
formatted in civilian time(am or pm)
def printSelectedFlight(airD,airline,flightNum):
Needed Output:
Delta 1776 PHL 1:50pm RAP 4:10pm
#L12-8 Write a function def findFlight(airD,fromCity,toCity):
that will
print out all Airlines and flight numbers and times that match the
specified
fromCity/toCity parameters. Within Airlines, sort the flights by
departure
time
def findFlight(airD,fromCity,toCity):
Needed Output:
Delta 1009 MDW 1850 IND 1955
Delta 9001 MDW 2145 IND 2255