if I have a file which contains
- 10,20,,30
- 10,20,5,20
- 3,20,19,50
- 10,20,10,30
how to get the sum of each line and ignore that the first line has a blank element
this is what I've got, but it only gives me this error message
TypeError: unsupported operand type(s) for +: 'int' and 'str'
file = open(inputFile, 'r')
for line in file:
result = sum(line)
print(result)