title: python list generation/saving bug
body: <p>I am trying to make program that prints all the possible combinations for <code>a</code> to <code>zzz</code>. I tried to add a save state feature, and it works fine but there is this bug.</p>
  
  <p>Let's say I interrupted the program when it printed something like <code>e</code>. When I execute the program again, it works fine until <code>z</code> but after <code>z</code> instead of printing <code>aa</code> it prints <code>ba</code> and continues from <code>ba</code>. This happens right after it prints <code>zz</code> too. it prints <code>baa</code> instead of <code>aaa</code>. How can I fix this?</p>
  
  <p>Here is what I did so far:</p>
  
  <pre><code> import pickle,os,time
  
   alphabet="abcdefghijklmnopqrstuvwxyz"
   try:
       if os.path.isfile("save.pickle")==True:
           with open("save.pickle","rb") as f:
               tryn=pickle.load(f)
           for i in range(3):
               a=[x for x in alphabet]
               for j in range(i):
                   a=[x+i for x in alphabet for i in a]
               b=a[tryn:]
               for k in b:
                   print(k)
                   time.sleep(0.01)
                   tryn+=1
       else:
           tryn=0
           for i in range(3):
               a=[x for x in alphabet]
               for j in range(i):
                   a=[x+i for x in alphabet for i in a]
               for k in a:
                   print(k)
                   tryn+=1
                   time.sleep(0.01)
   except KeyboardInterrupt:
       with open("save.pickle","wb") as f:
           pickle.dump(tryn,f)
  </code></pre>