Skip to content

Instantly share code, notes, and snippets.

@AlexMikhalev
Created May 12, 2010 10:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlexMikhalev/398437 to your computer and use it in GitHub Desktop.
Save AlexMikhalev/398437 to your computer and use it in GitHub Desktop.
summa = 0
for A in S:
for P in A.PS:
summa += P.N
-----------------
summa = sum([P.N for A in S for P in A.PS])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment