Write a python program to generate the ticket numbers for specified number of passengers traveling in a flight as per the details mentioned below:
The ticket number should be generated as airline:src:dest:number
where
- Consider AI as the value for airline
- src and dest should be the first three characters of the source and destination cities.
- number should be auto-generated starting from 101
The program should return the list of ticket numbers of last five passengers.
Note: If passenger count is less than 5, return the list of all generated ticket numbers.
Sample Input | Expected Output |
airline = AI | ['AI:Ban:Lon:106', 'AI:Ban:Lon:107', 'AI:Ban:Lon:108', 'AI:Ban:Lon:109', 'AI:Ban:Lon:110'] |
airline = BA | ['BA:Aus:Fra:101', 'BA:Aus:Fra:102'] |
SOLUTION:
0 Comments