menu
techminis

A naukri.com initiative

google-web-stories
Home

>

Programming News

>

Comprehens...
source image

Dev

3w

read

426

img
dot

Image Credit: Dev

Comprehension in Python (2)

  • Python offers comprehensions like list comprehension, set comprehension, dictionary comprehension, and generator comprehension.
  • Generator comprehensions are created using (). Generators can be passed to a function without ().
  • 1D generator comprehensions produce a sequence of values based on an iterable. The end result is a generator object.
  • 2D generator comprehensions create a sequence of generators based on nested iterables. The outcome is a generator object of generator objects.

Read Full Article

like

25 Likes

For uninterrupted reading, download the app