Hey guys,
I been working on a small project I found on another forum. It's supposed to decode scrambled word from a word list in 30 sec or less. Well I'm pretty noobish so my method might not be all that great, but I'm giving it a go and learning quite a bit along the way. Anyways I figured out how to get the information from the files and put it into lists, but the problem I'm facing now is that the copied lists carry over the \n with them, which I need to get rid of. Any ideas or suggestions would be awsome thanks.

here is the code:

#decode scrambled word from a word list in 30 sec or less.
wordlist = []
possible = []
matches = []
wordlist = []
i = -1
p = 0
wordlistfile = open('C:\\Documents and Settings\\William\\Desktop\\wordlist\\wordlist.txt', 'r')
possiblefile = open('C:\\Documents and Settings\\William\\Desktop\\possible.txt', 'r')

#add file contents to lists.
for line in wordlistfile:
for line in possiblefile:

for line in wordlist:
    i = i + 1
    if len(wordlist[i]) == len(possible[p]):
print matches



Something like this will do:

for line in wordlistfile:

Thanks works like a charm. What exactly does strip() do though? Just wondering.

I see thanks, that is one of the few items in the library that I can actually understand, lol. I'm not very good with the terminology so it always sounds so cryptic in the definitions.;)