I've got a list of different strings (this is an example):
strs = ["FOOBAR", "PYTHON", "MAPARTS"]
and I've got another list with substrings that one of the strings in the previous list might contain:
substrs = ["ARTS", "FOO", "PY", "BAR", "MAP"]
I want to make a list that has all the strings in strs that can be split using two strings in substrs, split by them and wrapped in a list or tuple. So the finished list would look like:
[("FOO", "BAR"), ("MAP", "ARTS")]
I can't wrap my head around how to manage it, at least in a simple way. Any help?