Created
November 3, 2018 09:40
-
-
Save Ikhiloya/1b408ffe0cfd65a0199ef843ad0cff5a to your computer and use it in GitHub Desktop.
list filtering with lambda expression and slicing
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
| garbled = "IXXX aXXmX aXXXnXoXXXXXtXhXeXXXXrX sXXXXeXcXXXrXeXt mXXeXsXXXsXaXXXXXXgXeX!XX" | |
| message = filter(lambda x: x != 'X' , garbled) | |
| print message | |
| garbled = "!XeXgXaXsXsXeXmX XtXeXrXcXeXsX XeXhXtX XmXaX XI" | |
| message = garbled[::-1][::2] | |
| print message |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment