title: How can I specify each iteration in a for loop's output? Python
body: <p>I have a .json file with multiple values, seperated by commas. I would like to go through the file and output each value sequentially, as variables. The first one being x1, the second one being x2 and so on. The point is so that I can use these values in an equation later on.
  The output would look like this:</p>
  <pre><code>x1 = 0.0234
  x2 = 0.512
  x3 = 0.9782
  </code></pre>
  <p>I pretty sure I need to use a for loop after this:</p>
  <pre><code>g = open('beat_times_knownsong1.json')
  another_song = json.load(g)
  </code></pre>
  <p>EDIT: this is some of the .json data:</p>
  <pre><code>0.023219954648526078,
      0.5108390022675737,
      0.9752380952380952,
      1.4628571428571429,
      1.9504761904761905,
      2.414875283446712,
      2.9024943310657596,
      3.3668934240362813,
      3.8545124716553287,
      4.31891156462585,
      4.806530612244898,
      5.270929705215419,
      5.758548752834467,
      6.222947845804988,
      6.710566893424036,
      7.174965986394557,
  </code></pre>
  <p>they're just numbers increasing in value. If I just do:</p>
  <pre><code>g = open('beat_times_knownsong1.json')
  another_song = json.load(g)
  
  for beat in another_song:
      print(beat)
  </code></pre>
  <p>then it just prints the values. I would like for it to save each value to an &quot;x&quot; variable, increasing from x1 = 0.023219954648526078 to x2, x3 and so on.</p>