This issue describes how to implement the generator-expressions 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:
Goal
The goal of this exercise is to teach the syntax and variants of generator expressions in Python.
Learning objectives
- Understand how a
generator expression relates to both a list comprehension and a generator
- Understand where
generator expressions can and cannot be utilized
- Create a
generator expression
- Use a generator expression as an argument to a function such as
''.join() or sum()
- Use a generator expression as an element of a comprehension
Out of scope
- Memory and performance characteristics and optimizations
- Generator methods such as
throw() and close()
- Using the
assignment expression (walrus operator) with a generator expression
Concepts
Prerequisites
basics
conditionals
comparisons
loops
generators
iterators
iteration
list-comprehensions
other-comprehensions
Resources to refer to
Hints
After
- Additional
Generator-iterator methods, such as generator.send() and generator.throw()
generator expressions
- Asynchronous generator functions
generators used as coroutines
Representer
No changes required.
Analyzer
No changes rquired.
Implementing
Help
If you have any questions while implementing the exercise, please post the questions as comments in this issue.
This issue describes how to implement the
generator-expressionsconcept 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:
Goal
The goal of this exercise is to teach the syntax and variants of
generator expressionsin Python.Learning objectives
generator expressionrelates to both alist comprehensionand ageneratorgenerator expressionscan and cannot be utilizedgenerator expression''.join()orsum()Out of scope
throw()andclose()assignment expression(walrus operator) with agenerator expressionConcepts
generator expressionsPrerequisites
basicsconditionalscomparisonsloopsgeneratorsiteratorsiterationlist-comprehensionsother-comprehensionsResources to refer to
Hints
Generator Expressionssection of the Python docs tutorial: Generator expressions and list comprehensions (Python official docs)After
Generator-iterator methods, such asgenerator.send()andgenerator.throw()generator expressionsgeneratorsused as coroutinesRepresenter
No changes required.
Analyzer
No changes rquired.
Implementing
Help
If you have any questions while implementing the exercise, please post the questions as comments in this issue.