So a fairly simple problem which I'm trying to solve in the most efficient way possible.

I am querying an API which outputs a series of namedtuples, and I want to accumulate and sum the value of each outputted tuple.

i.e i'm doing something like the following:

```
for time_series in api_query:
    for ts_tuple in time_series.header:
        print(ts_tuple)

```

which would output something like:

```
Point(end_time='2017-07-05T12:12:24.471Z', start_time='2017-07-05T12:11:24.471Z', value=0)
Point(end_time='2017-07-05T12:13:24.471Z', start_time='2017-07-05T12:12:24.471Z', value=48)
Point(end_time='2017-07-05T12:14:24.471Z', start_time='2017-07-05T12:13:24.471Z', value=11)
Point(end_time='2017-07-05T12:15:24.471Z', start_time='2017-07-05T12:14:24.471Z', value=0)
Point(end_time='2017-07-05T11:52:24.471Z', start_time='2017-07-05T11:51:24.471Z', value=0)

```

I need to grab the value in each namedtuple, and sum the total.

What I've got is:

```
   total_foo = []

   for time_series in api_query:
        for ts_tuple in time_series.header:
            total_foo.append(ts_tuple.value)

```

then just call a sum on total\_foo.

I was wondering whether anyone can suggest a more pythonic way? I'm trying to get away from just using for loops and appending to lists all the time.

NB: for some background the api is querying a Stackdriver metric via the `google-cloud-python` library.