Comment

Comment by ziikutv

You can also use a list comprehension like so.

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

parent ziikutv 8 years ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton