write a python program to sum of all the items in a list
Answers
Answered by
0
Answer: Python program
#create a list
a = [2,3,4,5,6,7,8,9]
#then use the sum to get the sum of all the items of list
print(sum(a))
If your list contains strings and int both then it will show error as strings can't be added to int or float
string can be add to a string
if u want to add the items of two string use + operator
list[1] + list[2]
it will create a list will all the elements in list 1 and list 2
Similar questions