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

 

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

Write a function that takes a 2D list grid and computes a new list L, where L[c] is the sum of column c in grid. To figure out the example cases, you might want to draw the 2D list on paper.


sumCols([[1, 2, 3, 4], [0, 5, 2, 1], [3, 3, 2, 0], [0, 0, 4, 8]]) → [4, 10, 11, 13]
sumCols([[6]]) → [6]
sumCols([[6], [-3]]) → [3]

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

def sumCols(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