Answered step by step
Verified Expert Solution
Question
1 Approved Answer
simple python programme for 8 8. Design the function get_flights_in_month that takes a list of flight schedule information tuples (as described in specification 7) and
simple python programme for 8
8. Design the function get_flights_in_month that takes a list of flight schedule information tuples (as described in specification 7) and an additional argument that specifies a valid month. The function should return a list of just the flight information (as described in Lab 7) of the flights in the in the given list that are scheduled in the given month. The function should assume the second argument is a valid month in the Gregorian calendar (our Calendar) and the initial letter is capitalized and no abbreviations are used. Example: flight_van_tor = ('Vancouver', Toronto', 4) dates_van_tor = |(2020, October', 1).(2020, October', 12), (2020, 'November', 12), (2020, December', 1)] flight_schedule_van_tor = (flight_van_tor, dates_van_tor) flight_lon_mos = ('London', "Moscow, 6) dates_lon_mos = [(2020, October', 21), (2020, December', 14) flight_schedule_lon_mos = (flight_lon_mos, dates_lon_mos) flight_sea_bang = ('Seattle', 'Bangkok', 6) dates_sea_bang = [(2020, October', 18), (2020, "November', 6)] flight_schedule_sea_bang = (flight_sea_bang, dates_sea_bang) list_of_flight_schedules = [flight_schedule_van_tor, flight_schedule_lon_mos, flight_schedule_sea_bang) The function call get_flights_in_month(list_of_flight_schedules, 'October") returns: [('Vancouver' , 'Toronto', 4), ('London", "Moscow', 6), ('Seattle', 'Bangkok', 6)] since all three flights are scheduled to fly in October. The function call get_flights_in_month(list_of_flight_schedules, "November) returns: [('Vancouver', 'Toronto', 4), ('Seattle', 'Bangkok', 6)] since there are no flights from London to Moscow in NovemberStep 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