+ 2
Please help
how can I add all integers in my array .. in python for example I have array= [1,2,3,4,5]
6 Answers
+ 1
can I do it without loop ?
+ 1
Yes
a = [1,2,3,4,5]
a = sum(a)
print(a)
+ 1
what if i want an input from user and then add those integers...
it is showing error
+ 1
It throws an error because you are not using an array.
+ 1
array=list(int(input()))
i=sum(array)
print(i)
it's not working
0
Are trying use that in your Basic calculator code?