I have the following list:
lst = ['AAAAAABB', 'AAAAAABA', 'AAAAAAAB', 'AAAAABAA', 'AAAAABAB', 'AAAAABBA']
And I'm getting this:
lst = ['AAAAAAAB', 'AAAAAABA', 'AAAAAABB', 'AAAAABAA', 'AAAAABAB', 'AAAAABBA']
But I want something like this:
lst = ['AAAAAAAB', 'AAAAAABA', 'AAAAABAA', 'AAAAAABB', 'AAAAABAB', 'AAAAABBA']
It means, I want to sort my list by Python considering the sequences of A and B in each list item.
Actually, I want that all the combinations with 7*A should appear first. After that should come the combinations with more than one B.