Hacker News new | ask | show | jobs
by mhashemi 2964 days ago
That's a great example! Mind if I use it? ;)
1 comments

You can also use a list comprehension like so.

>>> sum([x['moons'] for x in target['system']['planets']])