title: Trying to sum a list
body: <p>I am trying to sum a list, but am having trouble doing so. It seems that my code creates a seperate list for each iteration in the list. Are there any suggestions you have to summing all these numbers together?</p>
  <pre><code>def looping():
      for i in range(len(flat)):
  
      call_value_bs= []
      put_value_bs= []
      sigma_percentage = terminal_prices.std() / 100
      item = flat[i]
  
      r = .015
      S = item
      #print(S)
      K= 120
      T = 365/365
      sigma = sigma_percentage
  
      d1 = (np.log(S/K)) + ((r + sigma**2 /2)*T) / (sigma*np.sqrt(T))
      d2 = d1 - (sigma*np.sqrt(T))
  
  
      call_value_bs.append(((S*norm.cdf(d1))- K * math.exp(-1 *r*T) * (norm.cdf(d2))))
      
      call_value_bs = [ 0 if x &lt; 0 else x for x in call_value_bs]
      
      
      
      sum_call = sum(call_value_bs)
      print(sum_call)
  </code></pre>
  <p><a href="https://i.stack.imgur.com/QqIGA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QqIGA.png" alt="This is the output I would like to sum together " /></a></p>
  <p><a href="https://i.stack.imgur.com/DIwqh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DIwqh.png" alt="This is the output I get when I sum them" /></a></p>