0
Why is this outputting 1, then just stopping?
I was expecting more lines to be outputted. Thanks for any help https://code.sololearn.com/cgsv661Yab43/?ref=app
1 Answer
+ 2
See your if condition of the outer loop which has a print statement is only true for the first iteration.
Because only in that case your "sum" and "i" are equal, so it prints the value 1.
But for the rest of the cases your "sum" and "i" are unequal, hence nothing is printed.