title: How to find the cumulative sum of numbers in a list?
body: <pre><code>time_interval = [4, 6, 12]
  </code></pre>
  
  <p>I want to sum up the numbers like <code>[4, 4+6, 4+6+12]</code> in order to get the list <code>t = [4, 10, 22]</code>.</p>
  
  <p>I tried the following:</p>
  
  <pre><code>t1 = time_interval[0]
  t2 = time_interval[1] + t1
  t3 = time_interval[2] + t2
  print(t1, t2, t3)  # -&gt; 4 10 22
  </code></pre>