I am doing the question in exercise with using for loop and if statement,the result came out to be 1
![image.png](https://365datascience.com/resources/qa-hub/thumb@1170_7f036xo290f.webp)
1 answers ( 0 marked as helpful)
Hi Muhammad!
Thanks for reaching out.
The return statement should have the same indentation with the for loop. Written this way, the result will be 1 because you return the result immediately after the first incrementation.
Hope this helps.
Best,
Tsvetelin