title: Trying to iterate in a list Python
body: <p>I'm still trying to create a semi-random list of letter. I want my list to have 60 letters but exactly 20% of the time I want the same letter than 2 letters back.. </p>
  
  <p>I did this code : </p>
  
  <pre><code>import random
  from random import shuffle
  import pandas as pd
  
  probab = range(61)
  
  shuffle(probab)
  
  letters = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L']
  
  my_list = [random.choice(letters) for _ in range(2)]
  
  for i in probab.items():
      if i &lt; 12:   # choice of number between
          my_list.append(my_list[len(my_list)-2])   # add the letter n-2
  
      else:
          my_list.append(random.choice(letters))
  
  print(my_list).     
  </code></pre>
  
  <p>The logic that I have we did problem is that I create a list from 1-60, then mixed it.</p>
  
  <p>After I want to do a loop, the code look if the first item is smaller than 12, if yes then add the same letter than 2 back if not add a random letter...</p>
  
  <p>I thought 12 because, its 20% of 60</p>
  
  <p>I get this error when I run the code listed :</p>
  
  <pre><code>for i in probab.items():
  AttributeError: 'list' object has no attribute 'items'
  </code></pre>
  
  <p>Thanks for your help. </p>