I'm doing an assignment for school, I'm up to a part where i have to have the 'User' input a list of integers, the program must then add the integers in the list together and return:
Total: $[sum of integers]
as of yet, i have
cost = input("Enter the expenses: ")
cost = int(cost)
total = sum(i)
print("Total: $" + i)
but it keeps returning the error:
Traceback (most recent call last):
File "C:\Python33\Did I Spend Too Much.py", line 2, in <module>
cost = int(cost)
ValueError: invalid literal for int() with base 10: '10 15 9 5 7'
Where '10 15 9 5 7' are the integers I entered in testing.
Any help with this would be greatly appreciated