Afrikaans
Akan
Albanian
Amharic
Arabic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
French
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Icelandic
Igbo
Indonesian
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (Soranรฎ)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Persian
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Russian
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Spanish
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Uzbek
Vietnamese
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
So welcome back, ladies and gentlemen.
I hope you try to solve this exercise on your own to solve this punishment.
And now let's move on to solving it together.
So the first thing that I want to say is a quick reminder of what we want to do.
Want to bring this message of I'm sorry for not listening.
For not listening.
Listen, listening to your teacher or Alphatech, let's say I will practice practice.
What was it like?
I will practice more next time.
OK.
So that's the message that we want to print a thousand times.
And one of the ways to do so is just by using the printf command.
Simply use a printer.
Okay.
And just copy and paste.
Are all of this message to here.
And now let's zoom out.
Now, if we take a look, we just printed out one message, one sorry message for just one time.
And what we can do, what we can do if we didn't practice enough and we were not listening for the feature,
we need to copy and paste this message a thousand times.
So one, two, three.
And there you go.
A thousand times.
So basically, that's kind of tedious, right?
We don't want to use a repetitive prayer or printf command if we know that we can use loops because
we said whenever we will have some task that repeats itself.
And in this case, that's exactly what happens.
Then we definitely should consider using loops.
So to use a loop here, we are probably going to use on what we are going to use.
We are going to use a for a loop, right.
Because we know in advance how many times we will do the same command.
So for that will create an eye variable int I.
OK.
And here we will use about for a loop.
So we're right, four are in the parentheses we specify there on initialization phase.
So I equals two.
One.
And as long as I is lask or equals two with thousand which means we'll run the loop body for a thousand
times.
And basically on every duration we are going to increment I by one.
And with this will be just our body, our preme def command.
So in these curly brackets, I just remind you guys here is going to be our body, our look body.
So on every duration, as long as I is less or equals to a thousand.
Okay.
On every duration we are going to print this message.
So basically that's it.
That's not a complicated exercise.
But but guys, can you notice that with using loops, we can do this in just a couple of lines instead
of copying and pasting.
Are all of these tedious work for a thousand lines and so on and so forth?
We are just using in this case, our new concept, new that we learned in this section, the four loops.
We could also use the wire loop.
But in this case, we decided to use for a loop for a reason.
So basically, that's neat.
I hope you got the idea.
And this punishment is over and your teacher will be definitely glad if he gave you he gave you this
task.
So thank you so much.
We're watching.
And let's move on.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.