All language subtitles for 17. break, continue, pass

af Afrikaans
ak Akan
sq Albanian
am Amharic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bem Bemba
bn Bengali
bh Bihari
bs Bosnian
br Breton
bg Bulgarian
km Cambodian
ca Catalan
ceb Cebuano
chr Cherokee
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
en English
eo Esperanto
et Estonian
ee Ewe
fo Faroese
tl Filipino
fi Finnish
fr French
fy Frisian
gaa Ga
gl Galician
ka Georgian
de German
el Greek
gn Guarani
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian
is Icelandic
ig Igbo
id Indonesian
ia Interlingua
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
rw Kinyarwanda
rn Kirundi
kg Kongo
ko Korean
kri Krio (Sierra Leone)
ku Kurdish
ckb Kurdish (Soranรฎ)
ky Kyrgyz
lo Laothian
la Latin
lv Latvian
ln Lingala
lt Lithuanian
loz Lozi
lg Luganda
ach Luo
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mfe Mauritian Creole
mo Moldavian
mn Mongolian
my Myanmar (Burmese)
sr-ME Montenegrin
ne Nepali
pcm Nigerian Pidgin
nso Northern Sotho
no Norwegian
nn Norwegian (Nynorsk)
oc Occitan
or Oriya
om Oromo
ps Pashto
fa Persian
pl Polish
pt-BR Portuguese (Brazil)
pt Portuguese (Portugal)
pa Punjabi
qu Quechua
ro Romanian
rm Romansh
nyn Runyakitara
ru Russian
sm Samoan
gd Scots Gaelic
sr Serbian
sh Serbo-Croatian
st Sesotho
tn Setswana
crs Seychellois Creole
sn Shona
sd Sindhi
si Sinhalese
sk Slovak
sl Slovenian
so Somali
es Spanish
es-419 Spanish (Latin American)
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
tt Tatar
te Telugu
th Thai
ti Tigrinya
to Tonga
lua Tshiluba
tum Tumbuka
tr Turkish
tk Turkmen
tw Twi
ug Uighur
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
wo Wolof
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu

Original subtitles

Welcome back now.

Up until now we saw the break.

Key word that we can use to break out of a loop and you see here that we're able to loop with a for

loop but with a while loop as soon as we break.

We're done.

We've just well broken out of the loop but could we do that in a for loop.

Let's find out yep.

Break.

Keyword works in a for loop as well but there's actually two other things that we can use besides break.

One is called continue and you can see here again blue highlighting if I do continue here and I click

Run.

There you go.

We get our looping again.

But you're thinking why why do we need this like it seems completely useless right.

Well a break.

When we use the break segment it breaks out of the current and closing loop.

So when we used a break statement we broke out of this loop.

Right.

This whole while loop we just exited it and same with the for loop.

We completely exited it however with a continue what we're saying is hey whatever happens when you hit

this line continue onto the top of the enclosing loop.

So the current closing loop What is it.

It's this for loop.

So it's going to go back to the for loop so that if I do something like print here so that we get it

printed twice or you know what let's just move print down here like that and then.

Same here.

We're going to just print out the bottom after continue.

If I click Run nothing gets printed because as soon as it sees continue it's going to say OK I'm going

to go back to the loop and it's going to keep going keep going keep going until well the loop ends so

that we never actually hit line 10 in line for so that becomes really useful and conditional logic as

well.

Finally the third one is called Pass and Pass is but not very useful.

It essentially does nothing if I click run here and again it shows me here line 10 something's wrong.

Well we have to move print up to the top so that while we don't get my list of index of three which

doesn't exist.

So again going back here if I click Run pass doesn't do absolutely anything it just essentially passes

to the next line.

So why is that ever useful.

It's very rare that you'll see pass in your code but pass is a good way to have let's say a placeholder

while you're coding for example you want to loop through the for loop but we don't know what we want

to do yet in the code.

Let's say that here we're still thinking about it.

If I do this and I click Run I get an error here because what Whoa well expected an indented block because

now the for loop or the python interpreters looking for the next.

Like what am I supposed to do with the loop.

I'm trying to loop and there's no code for me.

So you can add a pass here to at least fill something for the for loop to say hey I'm thinking about

it I'm just going to pass it for now just so you have something so you don't bug me and I'll come back

to it.

So if I click Run that still works.

So pass is one of those place holders that we can use so that there is a line of code that does absolutely

nothing that we can still pass through.

Again a very rare thing to see in production code.

But while you're developing some developers like using passed and there you have it break continue and

pass.

I'll see you in the next one.

Bob.

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.