title: how to change a variable name in a while loop?
body: <p>I have a question. I want to use a while loop and in the while loop I have to assign a view lists, but they shouldn't be assigned to the same variable over and over again. but I don't know how much lists I have to assign.</p>
  
  <pre><code>K = 2
  D = 2
  while( K &lt;= 2 or K &gt;= 20):
      K = int(raw_input("Give the number of candidates running for speaker. "))
      if(K &lt;= 2 or K &gt;= 20):
          print("Sorry, wrong input.")
  
  while(D &lt;= 2 or D &gt;= 1000):
      D = int(raw_input("Give the number of people who take part in the meeting. "))
      if(D &lt;= 2 or D &gt;= 1000):
          print("Sorry, wrong input.")
  
  row = 1
  vlist = [[]*D]
  while(D &gt; row):
      while(K &lt; len(vlist[row-1])):
          number = int(raw_input("Give a number of a person you want to win: "))
          if(0 &lt; number &lt; K and number not in vlist[row-1]): 
              vlist[row-1].append(number)
          else:
              print("Sorry, wrong input, try again.")
  
      row += 1
  </code></pre>
  
  <p>this is what I have now, but it throws the following error: List index out of range. I don't get why...</p>