I'm trying to calculate the sum of multiple numbers in one list, but there always appears an error. These numbers are readed from a txt.
Numbers:
19.18,29.15,78.75,212.10
My code:
infile = open("January.txt","r")
list = infile.readline().split(",")
withdrawal= sum(list)
Error:
withdrawal= sum(list)
TypeError: unsupported operand type(s) for +: 'int' and 'str'
list, you will see the type will not be integers or floats.