I'm new to python programming and I want to know how to write a python program to get a some user input integers as a list and add all the items in it.This is the code I've written..
A=list(input("Enter the values of the list "))
total=0
for a in A:
total=total+a
print(total)
When I run this program it says,
Traceback (most recent call last):
File "C:/Users/Jayaweera/Desktop/Python programming/51E5-sum all the items in a list.py", line 4, in <module>
total=total+a
TypeError: unsupported operand type(s) for +: 'int' and 'str'