exercism: complete plane-tickets (generate + assign + codes OK)

plane-tickets Exercise - Solution

This pull request contains a full implementation of the “Conda Airlines” exercise from the Exercism Python track.

:heavy_check_mark: Implemented Functions

  • generate_seat_letters(number): Yields seat letters from A to D in loop.
  • generate_seats(number): Yields seat numbers like 1A, 1B…, skipping row 13.
  • assign_seats(passengers): Assigns a seat to each passenger in order.
  • generate_codes(seat_numbers, flight_id): Generates unique 12-character ticket codes.

:white_check_mark: Tests

All 8 test cases pass with pytest:

$ pytest generators_test.py
============================= test session starts =============================
platform linux -- Python 3.11.2, pytest-7.2.1
collected 8 items

generators_test.py ........ [100%]
============================== 8 passed in 0.02s ==============================

exercism: complete plane-tickets (generate + assign + codes OK) by nanaelie · Pull Request #3912 · exercism/python · GitHub for reference.

It looks like you want to replace the student stub with your solution. Are you trying to show your solution off? You can go to Plane Tickets in Python on Exercism and publish your iteration to the Community Solutions tab. The stub file is given to students starting the exercise for the first time so they’ll see your finished solution instead of what’s currently there for them to implement. Giving them a solution up-front won’t help their coding journey I think. :slight_smile:

Ok I got it. I didn’t know