title: Repeat function does not work with list Python
body: <p>I have written a dice roller that generates random numbers and inserts them into a list. It then prints each iteration in the list.</p>
  
  <p>This works the first time it runs. However, when asked "do you want to reroll?" and choosing 'y' I get a <code>StopIteration</code> error</p>
  
  <p>Shouldn't Python just overwrite the list?</p>
  
  <p>EDIT: Added more code</p>
  
  <pre><code>File "./test.py", line 159, in diceRoller
    sname = it1.next()
  StopIteration
  
  
  
  
  #imports
  
  import random
  
  
  #Stats start at 0
  
  acc = 0
  com = 0
  con = 0
  dex = 0
  fig = 0
  inl = 0
  per = 0
  str = 0
  wil = 0
  
  
  sname = 0
  statList = ['Acc', 'Com', 'Con', 'Dex', 'Fig', 'Int', 'Per', 'Str', 'Wil']
  it1 = iter(statList)
  
  
  
  stat = []
  
  def diceRoller():
  
  
    rollcount = 1
    index = 0
    print ' '
    print "Rolling 3 d6's for each stat"
  
    print fmtt.format(' ', 'Stat','Your rolls', 'Total', 'Stat value') 
  
    while rollcount &lt; 10:
  
      die1 = random.randint(1,6)
      die2 = random.randint(1,6)
      die3 = random.randint(1,6)
      total = sum([die1,die2,die3])   
  
      rollcount += 1  
  
  
   (removed large if block - that sets bonus value)
    bonus = 4
  
  
  for item in range(1):
    stat.append(bonus)
  
  #print stat
  
  
  #for i in range(1):
    sname = it1.next()
  
  
  print fmt.format(' ', sname, die1, die2, die3, total, bonus)
  
  
  
    else:
      rroll = raw_input("Do you want to reroll? (y/n)")
      if rroll == 'y':
        diceRoller()
      else:
        statCalc()     
  
  #### END DEF diceRoller
  </code></pre>