Skip to content

Instantly share code, notes, and snippets.

@Deep18-03
Created March 29, 2020 16:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Deep18-03/89e88ef96501060f0d25a21c0e2339b1 to your computer and use it in GitHub Desktop.
Save Deep18-03/89e88ef96501060f0d25a21c0e2339b1 to your computer and use it in GitHub Desktop.
#use concept of list comprehension
a = [1, 1, 2, 3, 5, 2, 13, 21, 34, 55, 89]
print([a for a in a if a < 5])
@Deep18-03
Copy link
Author

print([number for number in a if number < 5])
proper way

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment