I am very super new at Python and I've run into a problem. I'm trying to convert a string of numbers into an int or float so that I can add them up. This is my first question/post. Any suggestions are greatly appreciated!
total = 0
s = '2, 3.4, 5, 3, 6.2, 4, 7'
for i in s:
total += int(i)
print total
I get the errors:
*3
4 for i in s:
----> 5 total += int(i)
6 print total
ValueError: invalid literal for int() with base 10: ','*