[Solved] Check if letters in list add up to a variable


Not sure why your question is drawing so much bad attention. permutations are what you need:

from itertools import permutations

def is_perm(letters,word):
    for p in permutations(letters):
        if ''.join(p) == word: return True
    return False
letters = ["a", "c", "t"]
word = 'cat'
print is_perm(letters,word)

Letters may of course be any list of strings, not just letters.

6

solved Check if letters in list add up to a variable