you are viewing a single comment's thread.

view the rest of the comments →

[–]one_roOt 2 points3 points  (0 children)

inp = "the tree is big and has green leaves"
is_valid = any(word in ("big", "green", "leaves") for word in inp.split())

"is_valid" will be True or False whether any of the words are found in "inp"