id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

david.white@denison.edu cs111fall2019 > sumRows
prev  |  next  |  chance

Write a function that takes a 2D list grid of numbers and then computes a new list L, where L[r] is the sum of all entries in row r in grid.


sumRows([[1, 2, 3, 4], [0, 5, 2, 1], [3, 3, 2, 0], [0, 0, 4, 8]]) → [10, 8, 8, 12]
sumRows([[-1, 6, 3, -4], [0, 0, 0, 0], [13, -3, 22, 10], [4, 9, -4, 5]]) → [4, 0, 42, 14]
sumRows([[6]]) → [6]

...Save, Compile, Run (ctrl-enter)

def sumRows(grid):

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Python Help

Copyright Nick Parlante 2017 - privacy