How do I add up all of the values of a column in a python array? Ideally I want to do this without importing any additional libraries.
input_val = [[1, 2, 3,
Try this:
input_val = [[1, 2, 3, 4, 5], [1, 2, 3, 4, 5], [1, 2, 3, 4, 5]] output_val = [sum([i[b] for i in input_val]) for b in range(len(input_val[0]))] print output_val