Best way for permutating using multiple lists?

hob cokofreedom at gmail.com
Fri Nov 6 08:32:58 EST 2009


if __name__ == '__main__':
    permutations = list()
    for i in list('def'):
        for j in list('abc'):
            for k in list('mno'):
                for l in list('mno'):
                    for m in list('wxyz'):
                        permutations.append()
    print '\t'.join("%s" % i for i in permutations)

I'd rather find a way that can perform a permutation over any number
of lists. I know there should be a way of doing this but my head isn't
working today, any advice people?



More information about the Python-list mailing list