i have an array of input of numbers, how can i add them all ? (Python) | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

i have an array of input of numbers, how can i add them all ? (Python)

please write a code related to it in Python

17th Feb 2018, 1:50 PM
Jashan Singh
Jashan Singh - avatar
3 Answers
+ 1
in javascript : for(i=0;i<arr.length;i++){ result += arr[i]; }
17th Feb 2018, 4:32 PM
Dominique Abou Samah
Dominique Abou Samah - avatar
+ 1
bro thats good but i dont know how would i do the same thing with python..
17th Feb 2018, 4:34 PM
Jashan Singh
Jashan Singh - avatar
0
you can do it this way: i = "" while i < arr.length: result += arr[i] i++
17th Feb 2018, 4:40 PM
Dominique Abou Samah
Dominique Abou Samah - avatar