@yesserlabidi7831

this is the best explanation ever of while loop !! thank you sir !

@shazrakhalid1641

I WAS STUCK ON THIS FOREVER!!! THANK YOU!!!

@serdarkaraca9172

The first "i" is equal to 0 (i = 0). But, before it gets printed it goes through the equation of i = i + 1 so the first i that gets printed is 1.

Now at the i = 8 mark it goes through the equation i = i+1 (before getting printed) and gets printed out as 9. Then 9 != 10 goes through and gets printed as (the last number) 10. Then when 10 goes through it becomes 10 != 10 WHICH IS FALSE so ends the while loop.

as printed (1,2,3,4,5,6,7,8,9,10). D - "Print out the numbers from 1 to 10"

@sayedibrahim6131

one of the best explanations ever for while loop 🔁 ❤️ thanks

@brucewayne3141

This is so much better than the way my instructor told us!

@venkatraman_padmanaban

Print from 1 to 10 values and comes out of the loop

@suomynona7261

OMG you explained this so well! Thank you! I couldn’t wrap my head around WHY is was doing that. I knew how to control it by memory alone but not by understanding. 🙏

@doubleq1223

came here for loops brother, was bamboozled

@YoshevElazarMikael

I was given an example:
n = 5
while n > 0:
    n = n - 1
    print(n)
4
3
2
1
0
From this result: it is clear that the layout in the body is wrong; the 'print()' statement should go first.

@rashulmehul5779

We want more videos of this loop programs

@marctkocz1478

10/10
Really nice explained👌🏽
Thanks a lot

@bblife167

i love you so much you saved me 100%. thanks a lot fr. youre a real one

@Septix

Actual answer is 1-10: Option 4. The reason it stops at 10 instead of 9 now is because it's checking... is i = 10 yet? once it says YES then we exit the loop. The loop terminates RIGHT there because it reached its goal which is 10. Only part i don't get is why it does not start at 0 to 10... why 1.

@azeemsiddiqui3853

It will produce error since the test expression is not true. So the block will also not be executed. Numbers are only incrementing if the test expression is true only.

@amf2702

The answer is that the program prints out the numbers from 1 to 10

@aybin.v.k9562

Thanks for comparing While and if.......
can we use colon instead of parenthesis in WHILE ???
Semicolon after printf() is missing

@mlittleprogramming

Great video!

@minitaz3167

Option d is correct

@LukeJosiahNadal

i = 0
while i is not equal to 10
i = i +1
print i

is i not equal to 10? ( i = 0)
Yes, the program ends until it keeps adding the value 1 to the variable i until it defies the while condition, repeating the while loop 9 times until "not equal to 10" becomes "equal to 10". Thank me later

@artursweden3653

A perfect explanation