exercism / python

Exercism exercises in Python.
https://exercism.org/tracks/python
MIT License
1.87k stars 1.26k forks source link

[New Concept Exercise] : generators #2293

Closed BethanyG closed 2 years ago

BethanyG commented 4 years ago

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

Out of scope

Concepts covered

Prerequisites

Resources to refer to

Hints

Concept Description

(a variant of this can be used for the v3/languages/python/concepts/<concept>/about.md doc and this exercises introduction.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:

Representer

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 named generators_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.

BethanyG commented 3 years ago

@djjohnsongeek is going to take this on. 🎉 🌟

J08K commented 2 years ago

Heya, I am going to work on this.

My idea

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:

I think these should cover most of generators, but I am still stuck on how to implement __next__() and next() into the exercise itself.

djjohnsongeek commented 2 years ago

Yeah sorry I realize I never got to this. My personal life sorta blew up right after I started contributing.

BethanyG commented 2 years ago

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! 😄

djjohnsongeek commented 2 years ago

@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.

BethanyG commented 2 years ago

@djjohnsongeek -- WOW 😮 That is a LOT of new! Congratulations! 🌟

...and just give a shout when you want to ease back into contributing. 😄

J08K commented 2 years ago

Wowie, congratulations on the kid! I wish you good night's rest! :stuck_out_tongue: Enjoy every moment, and we'll see you around!

djjohnsongeek commented 2 years ago

Thank you both!

BethanyG commented 2 years ago

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!