- 1
Can you add all the integers in a list?
Let's say I have a list that has [ 1, 2, 3, 4]. I want to add all the integers to get the value 10. How do you that in Python
3 Antworten
+ 1
a=0
For i in list:
a+=i
+ 1
Thanks kiibo it helped
Let's say I have a list that has [ 1, 2, 3, 4]. I want to add all the integers to get the value 10. How do you that in Python