title: How can I fix an IndexError regarding the random choice method?
body: <p>I am getting an <code>IndexError</code> and I'm unsure why.</p>
  <pre><code>cards = [2, 3, 4, 5, 6, 7, 8, 9, 10 ,11, 12, 13, 14,
           2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
           2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
           2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
  USER = []
  CPU = []
  selected = 1
  while selected &lt; 26:
      CPU.append(cards.pop(random.choice(cards)))
      USER.append(cards.pop(random.choice(cards)))
      selected = selected + 1
  </code></pre>
  <p>I want the items inside the list <code>cards</code> to be appended into the lists <code>USER</code> and <code>CPU</code>. It worked originally but after working on something else it stopped working. I looked up why but the <code>pop</code> index says it's out of range, but I don't understand why.</p>