+ 2
Plz explain this
2 Answers
+ 2
Well you are initilializing the array of ints and the the variable sum. Then you iterate via loop through the array of these ints and you add them to the sum variable. Then you print it.
Also the += operator is shortcut. Consider this : x = x + variable, now this x += variable
+ 5
variable sum iterates through all the values in the array like..
sum+=arr[0]
sum+=arr[1]
sum+=arr[2]
till....4
where x is 0,1,2,3,4
so sum is the summation of each element in the array
Hot today
Please help, any idea?
2 Votes
Loop question, I've tried everything that I knew I just don't know. Please help me solve it out
1 Votes
Python — File Handling
0 Votes
What is wrong? Error on test.
1 Votes
Help me solve this (using loop)
1 Votes
Help me wiht python
1 Votes