Skip to content

Instantly share code, notes, and snippets.

@bauergeorg
Last active May 26, 2021 07:02
Show Gist options
  • Save bauergeorg/8d47232319980a4b3ad6b5f644150253 to your computer and use it in GitHub Desktop.
Save bauergeorg/8d47232319980a4b3ad6b5f644150253 to your computer and use it in GitHub Desktop.
parse a string in a list of strings
# 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