HN
Hacker News
Top
New
Best
Ask
Show
Jobs
Comment by mhashemi | Hacker News Reader
Parent
Full thread
mhashemi
·
That's a great example! Mind if I use it? ;)
View on HN
ziikutv
·
You can also use a list comprehension like so.
>>> sum([x['moons'] for x in target['system']['planets']])
Reply on news.ycombinator.com