title: Adding in python
body: <pre><code>while i&lt;10:
     a = a + i
     print (a)
     i = i+1
  </code></pre>
  
  <p>or</p>
  
  <pre><code>for i in range(10):
     sum = sum + i
     print
  </code></pre>
  
  <hr>
  
  <pre><code>0
  1
  3
  6
  10
  15
  21
  28
  36
  45
  </code></pre>
  
  <p>Then how can I add them together by writing further codes?
  I mean 1+3+6+10+15+21+... Then set the total as variables!
  That would be great if you can show me in both loop :)</p>