title: Loop through tuple and calculate percentage of a number
body: <p>I am trying to loop through the below <code>tuple</code> (<code>tuple1</code>), create a <em>total</em> from the integers (<code>b</code>), calculate a the <em>percentage</em> each value represents, and store it along with variable <code>a</code>, in a new variable (<code>a_percent</code>)</p>
  
  <p>I have attempted the following:</p>
  
  <pre><code>tuple1 = [('Data1', 33), ('Data2', 52), ('Data3', 85)]
  
  total = b
  for a, b in tuple1:
      total += b
      y = b/total*100.0
      a_percent = a, y
  </code></pre>
  
  <p>My <strong><em>expected</em></strong> output for a_percent is e.g. for <code>Data1</code>: (<code>33/(33+52+85)*100</code>):</p>
  
  <pre><code>Data1, 19.4 ...   
  Data2, 30.5 ...
  Data3, 50
  </code></pre>
  
  <p>However, it appears as followed instead:</p>
  
  <pre><code>('Data1', 100.0)
  ('Data2', 0.0)
  ('Data3', 0.0)
  </code></pre>