- 1
Can someone help me answer question 4&5 in module 3's quiz
2 Answers
+ 1
in question 4 the 'return' is inside the for so it breaks the code after one iteration
'i' will take values between 0 and 9
but the 'return' stops the code after 'i' has taken its first value
0
for question 5 the return is out of the for so it doesnt break the code immediately
i will take values between 0 and 3
so res =0+0 thenrm res 0+1 then res= 1+2 then res= 3+3