Help - just a few lines of code needed

johnzenger at gmail.com johnzenger at gmail.com
Mon Mar 6 21:05:35 EST 2006


There is some fine permutation code in the cookbook.  Take a look at
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/190465 .

You can easily code something like:

# xcombinations from the cookbook
def xcombinations(items, n):
    if n==0: yield []
    else:
        for i in xrange(len(items)):
            for cc in xcombinations(items[:i]+items[i+1:],n-1):
                yield [items[i]]+cc

wordlist = ['HOUSE','jolly','---','0&','99']

for i in xrange(1, len(wordlist)+1):
    for g in xcombinations(wordlist, i):
        print "".join(g)


> Unfortunately I am not able to program it myself, so
> I would appreciate if someone could write this piece of
> software, compile it (for DOS or Windows) and send the .exe file to:
>
> lory88 at gmail . com

Meet us halfway, here.  At least install Python.

Also, it's a dangerous world out there.  Don't run .exe s sent to you
by people you don't know.




More information about the Python-list mailing list