Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
bhargav
on May 9, 2018
|
parent
|
context
|
favorite
| on:
Glom – Restructured Data for Python
You can also use a list comprehension like so.
>>> sum([x['moons'] for x in target['system']['planets']])
Consider applying for YC's Spring batch! Applications are open till Feb 11.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search:
>>> sum([x['moons'] for x in target['system']['planets']])