Python - break vs continue vs pass

preview_player
Показать описание
In this video I will point out the differences between break, continue and pass with concrete examples.

*Please excuse the audio glitch at 0:0:17
"or else print 'hello', print 'please come here"
Рекомендации по теме
Комментарии
Автор

Check out more Python videos here:


Moving and Copy Files:

Lambda functions:


Python Map functions:


If __name__ == __main__:

PyMoondra
Автор

Thanks for this explanation, mate! Very thorough. The fact that you used the same example to explain all three functions was a cool idea.

soumyashreebiswal
Автор

This video is definitely underestimated. Great explanation, right examples. In other videos people are jumping from one example to another so its difficult to catch the clue. Thank you for your job, Sir!

iskandarzakirov
Автор

Thanks!
To summarize, the way I remember it is:
- Break: exit the loop
- Continue: don't execute what follows and continue the loop from the next value (worthy distinction because you kept saying that it takes us back to the beginning of the loop, which isn't exactly the accurate).
- Pass: skip the next line of code and continue from there.

chumbo
Автор

You explain the exact form of continue so that's why I love this video.😍😍😍

suriahossain
Автор

I was having a hard time understanding the difference of the three until I came across to this video. Thankyou

minato
Автор

This is a great video! I like how clear & easy it is to read the screen. In many videos I have seen in the past you have to squint to read what was typed. In the last video that I watched, this Youtube bot didn't even provide the print statements' answers. For an experienced programmer, this is no big deal, but it's good to see everything for a newbie like myself.

chrisfulop
Автор

Hello, thank you so much for these simple and well explained examples. I have a tendency to over complicate things, but I now see the pattern and understand what python is really doing in the loops!

MrNatkov
Автор

Thank you so much!!! the explanation is simple, clear, and exactly what I was looking for 🙌

apoorvavanaparthi
Автор

precise and to the point, very well explained with identical codes for all three variations.
commenting for the youtube algorithm so this gets more views

aryanbansal
Автор

Best explanation.Thank you so much sir.

ticklingtick
Автор

Much thanks for this wonderful and lucid explanation.

saket_saurav
Автор

the best explanation, straight to the point. Thanks.

dungtrinh
Автор

Thanks, watching from different tutorials but can’t understand it . this one is more comprehensive

godofdestruction
Автор

great but why are u lonely … go meet ur frnds and family please.. :)

ankitabasu
Автор

thank you, your explanation is simple and clear.

albertarysoesilo
Автор

Hi, you don't need to initialize i when using a for loop as this is catered for in the range start

maishamolepo
Автор

it the best example if the PASS/Break/Continue.

vladepast
Автор

Thank you very much for this, this example each very well

skyfalcon
Автор

Excellent explanation bro, I now know the difference clearly, Thanks much.

satishnaidu