Created
January 7, 2020 16:40
-
-
Save raihanba13/f9abfc3dc268e6fdc444828d06df6957 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
odd = lambda x : bool(x % 2) | |
numbers = [n for n in range(10)] | |
numbers[:] = [n for n in numbers if not odd(n)] # ahh, the beauty of it all | |
numbers | |
# output [0, 2, 4, 6, 8] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment