Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions exercises/concept/plane-tickets/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ The function should then return a _dictionary_ of `passenger` as _key_, and `sea
Conda Airlines would like to have a unique code for each ticket.
Since they are a big airline, they have a lot of flights.
This means that there are multiple flights with the same seat number.
They want you to create a system that creates a unique ticket that is _12_ characters long string code for identification.
They want you to create a system that formulates a unique ticket that is a _12_ character long string.

This code begins with the `assigned_seat` followed by the `flight_id`.
The rest of the code is appended by `0s`.
The rest of the code is filled with `0s`.

Implement a function `generate_codes(<seat_numbers>, <flight_id>)` that accepts a `list` of `seat_numbers` and a `string` with the flight number.
The function should then return a `generator` that yields a `ticket_number`.
Expand Down
3 changes: 2 additions & 1 deletion exercises/concept/plane-tickets/.meta/exemplar.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def generate_seats(number):
There is no row 13, and each row has 4 seats.
Seats should be sorted from low to high.
For exampl: 3C, 3D, 4A, 4B
For example: 3C, 3D, 4A, 4B
"""

Expand Down Expand Up @@ -72,6 +72,7 @@ def assign_seats(passengers):
output[passenger] = seat_number
return output


def generate_codes(seat_numbers, flight_id):
"""Generate codes for a ticket.
Expand Down
4 changes: 3 additions & 1 deletion exercises/concept/plane-tickets/generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@ def generate_seats(number):
There is no row 13, and each row has 4 seats.
Seats should be sorted from low to high.
For exampl: 3C, 3D, 4A, 4B
For example: 3C, 3D, 4A, 4B
"""

pass


def assign_seats(passengers):
"""Assign seats to passengers.
Expand All @@ -54,6 +55,7 @@ def assign_seats(passengers):

pass


def generate_codes(seat_numbers, flight_id):
"""Generate codes for a ticket.
Expand Down
Loading