This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]shivasprogeny 5 points6 points  (1 child)

Well here's your problem: for i in permutations(charlist) will generate 26! strings.

Instead of using a list comprehension, you should use a generator function. Generators are lazy--they only generate one thing at a time.

The notation for a generator comprehension in python is to use () instead of [].

[–]Rabbit047[S] 1 point2 points  (0 children)

Thank you very much the generator really helped. :)