Skip to content

Instantly share code, notes, and snippets.

@vinaykudari
Last active July 21, 2018 22:04
Show Gist options
  • Save vinaykudari/69ca7dda91249856a7e582b6b24eb920 to your computer and use it in GitHub Desktop.
Save vinaykudari/69ca7dda91249856a7e582b6b24eb920 to your computer and use it in GitHub Desktop.
List Comprehension Generator
lis = (i**2 for i in range(5))
>> type(list)
<class 'generator'>
>> list(lis)
[0, 1, 4, 9, 16]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment