Closed BethanyG closed 2 years ago
@djjohnsongeek is going to take this on. 🎉 🌟
Heya, I am going to work on this.
An airline needs your help with assigning seats for passengers, to do this they need you to make them a generator for that.
First, clarification:
A seat
uses the following format 11F
, with each 1
being a number from 1 through 9, AKA the rows
. And the F
is the seat in each row, it uses A through F
. It is important to note that a lot of airlines (we'll be using all airlines in the exercise) do not use row 13 because of the superstition surrounding it.
The exercise consists (prone to change) out of these functions/generators:
generate_seats
: Using the argument number_of_seats
generate that amount of seats by counting up 1A, 1B, 1C, etc.
inside a generator.assign_seats
: This generator needs to assign seats to a list of given passengers
. It returns a list of tuples, with (passenger_name, assigned_seat)
. These seats need to be generated by the previously mentioned function.I think these should cover most of generators
, but I am still stuck on how to implement __next__()
and next()
into the exercise itself.
Yeah sorry I realize I never got to this. My personal life sorta blew up right after I started contributing.
No worries @djjohnsongeek! We're happy you are back, and hopefully everything is going well for you.
If you'd like, I think @J08K might be open to collaboration? Just check in with him.
But there are also other issues (open issues) you can take on as well (if you'd like) -- just let us know! 😄
@BethanyG For the most part it has all been good stuff: new baby, new job, new house. New baby especially has trimmed all my free time 😄 I'd love to come back and contribute at some point, but still might be a while yet.
@djjohnsongeek -- WOW 😮 That is a LOT of new! Congratulations! 🌟
...and just give a shout when you want to ease back into contributing. 😄
Wowie, congratulations on the kid! I wish you good night's rest! :stuck_out_tongue: Enjoy every moment, and we'll see you around!
Thank you both!
Closing this issue, since we've merged the Plane Tickets
exercise. Any further changes will be logged in a new issue. Thanks everyone for your work!
This issue describes how to implement the
generators
concept exercise for the Python track.Getting started
Please please please read the docs before starting. Posting PRs without reading these docs will be a lot more frustrating for you during the review cycle, and exhaust Exercism's maintainers' time. So, before diving into the implementation, please read up on the following documents:
Please also watch the following video:
Goal
The goal of this exercise is to teach the syntax and use of
generators
in Python.Learning objectives
loops
anditerators
yield
keyword__next__()
methodOut of scope
throw(type, value=None, traceback=None)
close()
generator expressions
yield from
generators
used as coroutinesConcepts covered
generators
yield
__next__()
iterators
Prerequisites
conditionals
dicts
functions
higher-order-functions
lists
loops
iteration
iterators
sequences
Resources to refer to
Hints
Generators
section of the Python Docs Functional How to tutorial: GeneratorsConcept Description
(a variant of this can be used for the
v3/languages/python/concepts/<concept>/about.md
doc and this exercisesintroduction.md
doc.)Concept Description Needs to Be Filled In Here/Written
Some "extras" that we might want to include as notes in the concept description, or as links in
links.json
:Generator-iterator methods
, such asgenerator.send()
andgenerator.throw()
generator expressions
generators
used as coroutinesRepresenter
No changes required.
Analyzer
No changes rquired.
Implementing
The general Python track concept exercise implantation guide can be found here.
Tests should be written using
unittest.TestCase
and the test file namedgenerators_test.py
.Code in the
.meta/example.py
file should only use syntax & concepts introduced in this exercise or one of its prerequisites. Please do not use comprehensions, generator expressions, or other syntax not previously covered. Please also follow PEP8 guidelines.Help
If you have any questions while implementing the exercise, please post the questions as comments in this issue, or contact one of the maintainers on our Slack channel.