Question: simple python programme for 7(type alias for question 7 down below) 5. Design the function create_lodates that takes a list month names, a list of

simple python programme for 7(type alias for question 7 down below)

5. Design the function create_lodates that takes a list month names, a list of days as whole numbers and a list of years as whole numbers. The function should create and return a list of of date information tuples (as described in specification 3) constructed using the values in the given lists. Example: If the function is called with the following 3 lists: ['January', 'June'), [20, 10] and [1987, 2020) it should return the list: ((1987, January', 20), (2020, June', 10)] The order of the dates in the returned list must correspond to the order of the values in the given lists. The function should assume the given lists are all of equal length and that the values in the given lists combine to make valid dates. 6. Design the function contains_month that takes a list of date information tuples (as described in specification 3) and an additional argument the specifies a valid month. The function should return True if any of the dates in the given list are in the given month, and False otherwise. 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. 7. Copy the type alias for flight information that you designed in Lab 7. Using your flight information and date type aliases (as described in specification 3), you are now going to design a type alias to represent flight schedule information as a tuple with exactly these 2 things: the flight information, a list of dates that flight departs on Example: flight_van_tor = ('Vancouver', 'Toronto', 4) dates_van_tor = f(2020, October, 1), (2020, October', 12), (2020, 'November, 12), (2020, December, 1)) flight_schedule_van_tor = (flight_van_tor, dates_van_tor) 3. Design a type alias to represent the following flight information as a tuple: the departure city, the arrival city and the duration of the flight The type alias should assume the duration is in hours and it is more than 0 hours Example: ("Victoria', 'Mexico City', 5.5) 5. Design the function create_lodates that takes a list month names, a list of days as whole numbers and a list of years as whole numbers. The function should create and return a list of of date information tuples (as described in specification 3) constructed using the values in the given lists. Example: If the function is called with the following 3 lists: ['January', 'June'), [20, 10] and [1987, 2020) it should return the list: ((1987, January', 20), (2020, June', 10)] The order of the dates in the returned list must correspond to the order of the values in the given lists. The function should assume the given lists are all of equal length and that the values in the given lists combine to make valid dates. 6. Design the function contains_month that takes a list of date information tuples (as described in specification 3) and an additional argument the specifies a valid month. The function should return True if any of the dates in the given list are in the given month, and False otherwise. 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. 7. Copy the type alias for flight information that you designed in Lab 7. Using your flight information and date type aliases (as described in specification 3), you are now going to design a type alias to represent flight schedule information as a tuple with exactly these 2 things: the flight information, a list of dates that flight departs on Example: flight_van_tor = ('Vancouver', 'Toronto', 4) dates_van_tor = f(2020, October, 1), (2020, October', 12), (2020, 'November, 12), (2020, December, 1)) flight_schedule_van_tor = (flight_van_tor, dates_van_tor) 3. Design a type alias to represent the following flight information as a tuple: the departure city, the arrival city and the duration of the flight The type alias should assume the duration is in hours and it is more than 0 hours Example: ("Victoria', 'Mexico City', 5.5)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
