Skip to content

Instantly share code, notes, and snippets.

@bauergeorg
Last active May 26, 2021 07:02
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 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