Multiple if-statements with overwriting lists
You could do something like this:
possible_combinations = [&quot;ABC&quot;, &quot;AB&quot;, &quot;A&quot;, &quot;D&quot;]
combs = [(&quot;A&quot;,&quot;C&quot;),(&quot;A&quot;,),(&quot;C&quot;,)]

for comb in combs:
    chosen_comb = [x for x in possible_combinations if all([y in x for y in comb])]
    if len(chosen_comb) &gt; 0:
        break

print(chosen_comb)