0

Here's what I have so far

import csv
a= []

with open (r"C:\Users\packe\Downloads\transactions.csv") as f:
    reader = csv.reader(f)
    for column in reader:
        b=int(column[0])
        a. append(b)

transactions.csv contains these integers[25, 2, 8, -5, 4, 4, 3, 2, -2, 3] 25 being the first integer.

yasuomainbtw
  • 35
  • 1
  • 7

1 Answers1

2

You can use this to sum up all elements of a list except the first one:

sum(a_list[1:])

If the elements of the list are strings you can do:

sum(map(int, a_list[1:]))

Paco H.
  • 2,034
  • 7
  • 18