Adding all the integers returned from a for loop?
<p>I've just started with python and I'm writing a script that returns the number of clicks for a bunch of links. I'm using a for loop to iterate through all the links and return the click count for each: </p>

<pre><code>for url in short_urls:
    query_params = {
         'access_token': ACCESS_TOKEN,
         'link': url.values()}

    endpoint = ENDPOINT
    response = requests.get(endpoint, params = query_params)

    data = json.loads(response.content)

    print "link_clicks:" + " " + str(data['data']['link_clicks'])
</code></pre>

<p>The results returned into terminal look like this:</p>

<pre><code>link_clicks: 938
link_clicks: 63
link_clicks: 3921
link_clicks: 47
link_clicks: 21
</code></pre>

<p>What would be the best way to add all of those numbers and return a total? Ideally, I would like to be able to print the total as "total link_clicks: (total)" in terminal.</p>

<p><strong>EDIT:</strong></p>

<p>Thank you all for the answers.
I guess I was overcomplicating the solution in my head, for some reason I thought it would require creating a list to which each new integer from the for loop would have to be added and then individually adding each element of that new list via indexing to grab the total.</p>
