SyntaxFix
Write A Post
Hire A Developer
Questions
another way which can return the list of matching strings is
sample = "alexis has the control" matched_strings = filter(sample.endswith, ["trol", "ol", "troll"]) print matched_strings ['trol', 'ol']