title: generating variable names on fly in python
body: <p>Is there a way I can generate variable names in python in a loop and assign values to them? For example, if I have</p>
  
  <pre><code>prices = [5, 12, 45]
  </code></pre>
  
  <p>I want</p>
  
  <pre><code>price1 = 5
  price2 = 12
  price3 = 45
  </code></pre>
  
  <p>Can I do this in a loop or something instead of manually assigning <code>price1 = prices[0]</code>, <code>price2 = prices[1]</code> etc.</p>
  
  <p>Thank you. </p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Many people suggested that I write a reason for requiring this. First, there have been times where I have thought this may be more convenient than using a list...I don't remember exactly when, but I think I have thought of using this when there are many levels of nesting. For example, if one has a list of lists of lists, defining variables in the above way may help reduce the level of nesting. Second, today I thought of this when trying to learn use of Pytables. I just came across Pytables and I saw that when defining the structure of a table, the column names and types are described in the following manner:</p>
  
  <pre><code>class TableFormat(tables.IsDescription):
      firstColumnName = StringCol(16)
      secondColumnName = StringCol(16)
      thirdColumnName = StringCol(16)
  </code></pre>
  
  <p>If I have 100 columns, typing the name of each column explicitly seems a lot of work. So, I wondered whether there is a way to generate these column names on the fly. </p>