Skip to content

[New Concept Exercise] : generator-expressions #2292

Closed
@BethanyG

Description

@BethanyG

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

  • generator expressions

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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions