title: How to calculate sum using list comprehension
body: <p>
  How do I get the cumulative sum of this list using list comprehension:</p>
  
  <pre><code>list_comp=[1,4,9,16] 
  </code></pre>
  
  <p>
  Here's what I tried but it prints the double of each item in the list</p>
  
  <pre><code>print([x+x for x in list_comp])
  </code></pre>
  
  <p>
  I expect the results to be:
  list_comp=[1,5,14,30] 
  
  But I'm getting this:</p>
  
  <pre><code>&gt;&gt; [2, 8, 18, 32]
  </code></pre>