python 2.7 word generator
<p>Algorithm: take input on how many letters to go back, for loop to loop a-z, lock the first character, loop the second character, lock the first two, loop the third, and so on and so forth. The out put will look like a, b, c, d... aa, ab, ac, ad... aaa, aab, aac... and so on. I am very new to python. I have something that cycles through the alphabet, but my problem is to lock the first and cycle the second and so on.</p>

<pre><code>w = 'abcdefghijklmnopqrstuvwxyz'
n = input ("# of characters: ")

for a in range(0,n):
        for i in w:
                print i
</code></pre>

<pre><code>alphabet = 'abcdefghijklmnopqrstuvwxyz'
l= ['']
for i in range(input):
    l = [letter + item for letter in alphabet for item in l]
    for item in l:
        print(item)
</code></pre>

<p>I think this is what you're looking for</p>

python python-2.7