this is the best explanation ever of while loop !! thank you sir !
@NigerianxPrince2 жыл бұрын
I swear this is the best explanation I have seen for a while loop I really understand it so now I can write a code with this understanding.
@shazrakhalid16414 жыл бұрын
I WAS STUCK ON THIS FOREVER!!! THANK YOU!!!
@brucewayne31414 жыл бұрын
This is so much better than the way my instructor told us!
@serdarkaraca91724 жыл бұрын
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"
@nickri73523 жыл бұрын
Very detailed explanation
@chaitanyakishore21503 жыл бұрын
This is called a mind opening explanation.🌼
@karolstevenvillacarillo10363 жыл бұрын
wow
@Prince-jf1nb3 жыл бұрын
Wow thanks for the in-depth explanation
@tejasaditya5513 жыл бұрын
the value prints 1-10 if we put i=i+1 about print, can u explain why?
@doubleq12235 жыл бұрын
came here for loops brother, was bamboozled
@sayedibrahim61313 жыл бұрын
one of the best explanations ever for while loop 🔁 ❤️ thanks
@suomynona72613 жыл бұрын
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. 🙏
@venkatraman_padmanaban5 жыл бұрын
Print from 1 to 10 values and comes out of the loop
@rashulmehul57796 жыл бұрын
We want more videos of this loop programs
@bblife167 Жыл бұрын
i love you so much you saved me 100%. thanks a lot fr. youre a real one
@marctkocz1478 Жыл бұрын
10/10 Really nice explained👌🏽 Thanks a lot
@demetrik86424 жыл бұрын
Absolutely beautiful
@mlittleprogramming7804 жыл бұрын
Great video!
@Septix7 жыл бұрын
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.
@cobain12287 жыл бұрын
It starts at 0, but then in the block i=0+1, so i has a new value of 1, and finally print i that is equal to 1.
@williamngwaihow7 жыл бұрын
i = 0 while(i != 10): i = i + 1 print("i =", i) print("Exit Loop") Phython
@stannisbarracuda56936 жыл бұрын
it writes from zero and ends at 9 it would write 10 if the parameter was
@jamesclarity10776 жыл бұрын
@@stannisbarracuda5693 exactly that's what I was thinking... != In Python to the best of my knowledge is does NOT equal....so should have exited.... However my Python emulator is showing 10 too.
@jamesclarity10776 жыл бұрын
Scratch that....just gave this more thought think a little longer...
@aybin.v.k95627 жыл бұрын
Thanks for comparing While and if....... can we use colon instead of parenthesis in WHILE ??? Semicolon after printf() is missing
@damiaobrito64317 жыл бұрын
AYBIN. V. K it will always depend on what programming language you are using EDIT: as I can see, his code sample is based on Python
@artursweden3653 Жыл бұрын
A perfect explanation
@LukeJosiahNadal6 жыл бұрын
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
@iztirabk51354 жыл бұрын
true, same point noted here
@shivagaming50014 жыл бұрын
Word I noticed that but I'm just getting into it so I think it's still helpful. I would say this is an example of debugging because how he wrote it the program would print before any addition
@YoshevElazarMikael2 жыл бұрын
If 'i' is < 10, why would it print? While 'i' is less than 10, then the programme prints a value.
@punjab60443 ай бұрын
Thank you 🎊
@abubekirlenty88542 жыл бұрын
well done! thank you!
@indiaupbanda3 жыл бұрын
Simplest way.... Thank you so much
@minitaz31676 жыл бұрын
Option d is correct
@3372PHILIP6 жыл бұрын
Excellent explaination keep it up
@stutteringcris4683 жыл бұрын
i keep getting "invalid syntax" and the 3 keeps getting highlighted in the top "python 3.9.0"
@YoshevElazarMikael2 жыл бұрын
Thank you sir!!!
@amf27026 жыл бұрын
The answer is that the program prints out the numbers from 1 to 10
@benzox99404 жыл бұрын
Im stuck on this, Do you know why? And whats the difference when the addition follows the print?
@amf27024 жыл бұрын
@@benzox9940 bruh I forgot how it works, this was two years ago..
@dazza10804 жыл бұрын
😂😂😂😂
@sphollo14 жыл бұрын
@@benzox9940 its all about the sequence, having the i + 1 before the print command added 1 to the i value prior to it printing, so it started printing numbers starting with 1 then restarted the while loop and printed the numbers 1 to 10. If the i + 1 was after the print command it would have printed the number 0 then added 1 to i and restarted the while loop and printed all numbers from 0-10.
@abdullah3lshe77i85 жыл бұрын
THANK YOU SO MUCH BRO
@harryneuhoff91152 жыл бұрын
What language is this in??
@cancan7404 жыл бұрын
very good explanation
@HamzaShahzad15 жыл бұрын
produces an error, there is no parentheses around the print statement
@ivanjudiao2453 жыл бұрын
Yeah
@avivpizanty83843 жыл бұрын
what pen did you use? and where you wrote it?
@isaloy_23754 жыл бұрын
it does print 1 to 9 doesn't it ?
@anushkapandey85884 жыл бұрын
Is it 3) 1 to 9? Cause it'll only print after the initial value of i (0) is added to the operation *i = i + 1* And it also satisfies the condition that i ≠ 10
@JackM123451004 жыл бұрын
Remember that when the final loop begins when i=9 the condition is met (i is less than 10). Then the i is changed to 10 before i is printed, so this program would print 1 - 10.
@nomteemzee35402 жыл бұрын
what happens if you remove the condition of i= i +1
@m26k292 жыл бұрын
infintiiy loop will go on and prints 0 for infintiiy
@m26k292 жыл бұрын
@هههههههههههههههه مصرى
@YoshevElazarMikael2 жыл бұрын
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.
@stephenkite3994 жыл бұрын
Ok so I just got started in coding. My problem is i don’t understand where to execute my code. Is it supposed to work in the console? I’m using google chrome and I could really use someone’s help.
@ScholarDCareerSolutions4 жыл бұрын
you can watch this video.. kzbin.info/www/bejne/ZonEnnxnjJKqsKc
@vishalkatraj4 жыл бұрын
thank you
@WJGSix5 жыл бұрын
Ok so who had the right answer? I felt like it was 1 to 10
@ashwinv52195 жыл бұрын
It's 0 to 9
@keeshaholsey19737 жыл бұрын
love it
@denvd.b85597 жыл бұрын
there is no semilcolon in while( parenthesis)😐😐😐😐
@damiaobrito64317 жыл бұрын
diwakar bangera there is in Python programming language
@azeemsiddiqui38534 жыл бұрын
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.
@layanalkhatib64864 жыл бұрын
i used Small Basic program and my answer was : {print out the numbers from 0 to 9}.
@billygruff65416 жыл бұрын
0-9 ... sorry I took so long to comment.. I'm still on dial-up
@hibakhawaja95905 жыл бұрын
HOW?
@HJ-jl5pj8 жыл бұрын
is the answer the third option?
@bellagutierrez51946 жыл бұрын
H J it will print numbers 1-10 then exit the loop. Nine is not equivalent to ten so it will go through the loop one more time
@keeshaholsey19737 жыл бұрын
so cool
@ericplayer42038 жыл бұрын
it is an error right?
@joojok724 жыл бұрын
option d
@mohammadkhader17596 жыл бұрын
it will run forever , because its going to print all numpers but ten , >>>>>>1 2 3 4 5 6 7 8 9 11 12 13 .....
@TheAbsoluteSir4 жыл бұрын
Wrong, you misunderstand how iteration works.
@jess62413 жыл бұрын
doesnt it stop once y does not equal 10?
@abhisekchetri31365 жыл бұрын
X=1 Whilex
@floatiee2 жыл бұрын
D - Print out the numbers from 1 to 10
@chidex9685 жыл бұрын
option 2
@GhostRiderX76 жыл бұрын
The answer is Run forever
@AS-od4um5 жыл бұрын
Techie Tom no if the value of i is 10 So it will be 10 ! = 10 the statement will be false
@srilanka552903 жыл бұрын
The answer is for your quiz = 1 2 3 4 5 6 7 8 9 10 Thank you from Sri Lanka❤❤❤
@artistalreem11806 жыл бұрын
heloo any one can help me to solve this program Write a C++ programme that reads a sequence of integers terminated by zero value then finds the percentage of the negative numbers and the percentage of the positive number in the sequence. The programme output is as shown: : Enter a sequence of in integers terminated by zero 6 -7 -8 10 -12 14 15 2 -6 the percentage of negative numbers is 44.4 the percentage of positive numbers is 55.6
@ripndipp5 жыл бұрын
let a = "Hello, "; let b = "World"; let c = a + b console.log(c); thank me later this is the best i could do.
@walitouseef97517 жыл бұрын
Maybe runs forever
@phuturephunk7 жыл бұрын
In his last example (the question at the end), it will print 1 through 10 and then exit the loop.
@mohammadkhader17596 жыл бұрын
@@phuturephunk because it was asked to print all numpers that are less than ten , this question is diffrant , it askes for all numpers that does not equal ten ( 1 2 3 4 5 6 7 8 9 _ 11 12 13 ....)
@iliyasgangaram31344 жыл бұрын
it prints 1 to 10
@devika3894 жыл бұрын
writing with a pen ......but not really..........my heads' spinning
@hanaasleem12614 жыл бұрын
from 0 to 9 (b)
@AhmedSedik6 жыл бұрын
prints from 0-10
@felixnyarko78286 жыл бұрын
Answer is 1-10: Option 4
@TheAbsoluteSir4 жыл бұрын
Why would it not be B) 0-9 ? The previous while loop went from 0 through 9.
@nofilkhan67436 жыл бұрын
Answer is 1 to 10
@vincenthan59808 жыл бұрын
nb
@hydos38074 жыл бұрын
For while loop or statement click on the link kzbin.info/www/bejne/emjNYoyNqKhna6s
@ilikespaghetti21704 жыл бұрын
1-10
@aryamangurha6 жыл бұрын
lol u just made it unnecessarily complecated... For printing *"Ben"* 10 times in a loop: 10 FOR i = 1 to 10 20 PRINT "Ben" 30 NEXT i 40 END
@mustufashadab82015 жыл бұрын
Stupid he was teaching while loop not for loop
@MojeZycieWSkrocie5 жыл бұрын
try i = 11 lol
@devika3894 жыл бұрын
writing technique is soo distracting...............
@ScholarDCareerSolutions4 жыл бұрын
Try watching this video to understand loops.. kzbin.info/www/bejne/ZonEnnxnjJKqsKc
@karolstevenvillacarillo10363 жыл бұрын
hmmmmmm
@ameanasaur5 жыл бұрын
Great video but your hands distract from everything. We don’t need to see your hand writing it, we need to see the code. Also, use white font on a black background like anyone who stares at a screen for 8+ hours a day does, can’t watch this after a day of work + school.