Last active
May 26, 2021 07:02
-
-
Save bauergeorg/8d47232319980a4b3ad6b5f644150253 to your computer and use it in GitHub Desktop.
parse a string in a list of strings
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
# init | |
test_list = ['one', 'two', 'three', 'four'] | |
keyword = 'ree' | |
# one-liner | |
any(keyword in s for s in test_list) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment