I am trying to create an if condition that checks the existence of a certain string and its multiple forms in different lists. The condition currently looks like this.
if ("example_string" in node and "example_string" in node_names) or\
("string_similar_to_example_string" in node and
"string_similar_to_example_string" in node_names):
return response
Here node
is a string that matches the string exactly and node_names
is a list of strings that has strings matching the example string. This logic right now works, but I wanted to know if there is a better way to write this that makes it readable and clear.