Created
December 7, 2017 12:21
-
-
Save beta/d21dc6ed4eaa4c49d8cb1b5a5eadb210 to your computer and use it in GitHub Desktop.
List comprehension for generator in Python.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
squared_gen = (x**2 for x in range(5)) | |
type(squared_gen) # generator |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment