Advertisement
furas

Paste - sum

May 16th, 2017
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.28 KB | None | 0 0
  1. m = [[1,2,3], [4,5,6], [7,8,9]]
  2.  
  3. for row in m:
  4.     result = sum(row)
  5.     print(result)
  6.  
  7. #-----------------------------------------
  8.  
  9. m = [[1,2,3], [4,5,6], [7,8,9]]
  10.  
  11. all_results = []
  12.  
  13. for row in m:
  14.     result = sum(row)
  15.     all_results.append(result)
  16.  
  17. print(all_results)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement