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
Urdu
Uzbek
Vietnamese
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
So welcome back to the solution of this amazing exercise where we are going to print these following
nice pattern.
OK, so let's increase it a little bit.
OK, so we have this pattern that we want to print on the screen, on the console application that we
are using.
So in this pattern, what we can see is that it is compromised of ones in stars and one, two, one,
two, three and so on.
So we have to provide here two simple options for printing this pattern in.
The first option is going to be just to use a print off-line for every row.
So we can see here we have five rows, right.
And 10 columns probably.
So we are going to use print off-line for each of these columns.
So first of all, just use F print out and here specify a one in them.
One, two, three, four, five, six, seven, eight, nine.
And that's it.
And don't forget to specify the backslash.
And at the end of these print off-line, then would we have to do simply to use the same line and just
specify one, two, one, two, three, four, five, six, seven, eight.
And again, don't forget to use the best solution.
And of course, the semicolon in the end of this command to specify that we are over with this command
and we are ready to move on for the next one.
So that's how you do it.
And basically what we are going to do now is simply to copy these between the lines, one after the
other.
OK, so let's just align it correctly.
And there you go.
We have five lines, right, because we have a structure of just five lines and 10 columns.
And basically each of the columns is a little bit different.
Each of the rows is in each of the rows.
Sorry about that.
Each of their rows is a little bit different from one another.
So this row has two, three these row have has three, four and three, two, three, four, five.
Basically, that's the whole structure that we have.
That's the rectangle that we are requested to print.
So first of all, let's build and run this program to make sure that it works exactly as we expected.
So as you can see here, it's look, it's looking exactly as we wanted it to look.
And basically, there you go.
One thing that you have also to remember here is that you're requested, first of all, to print some
some, let's say, some shape to the screen that is compromised of a lot of characters.
So you need to understand how to approach and how to tackle these kinds of problems.
It's actually kind of problems for beginners.
Right.
But still, you need to understand how it works, how it looks, how to approach it.
And one of the ways that we said is that let's try to solve it simply by let's look at all of these
Betances, just a bunch of rows and columns and treat each row in a different predefined that will print
first row, second row and so on.
And basically nothing complicated so far.
We've managed to complete it successfully.
And now what I want us to do is simply to use the second option where we are going to use just one print
off-line and to print these are these structure by using just one print off-line and not using five.
So how it can be done, that's also not so complicated.
You know, that this backslash and specifies that you are going to get one line down.
Right.
And once you got one line down, you can simply print the next line.
So that's how you did that.
Now we printed this line and also if you are going to go like this one to three, so instead of using
it in the new line, you're going to print it right here.
And that's not something that we want.
We want to use, of course, a resolution to specify a new line.
And afterwards we are going to simply copy this line to here and this line we are going to copy here.
And finally, the fifth line we are going to copy here.
And basically that's how you do it.
That's how you solve this exercise with just one print off-line.
So let's just make sure that I'm not fooling you around and that everything I said works exactly as
I specified.
So building around it and there you go.
You can see your structure, your rectangle in the same format, in the same shape as you were requested
to make it.
So I think this is it for this video.
Guys, thank you so much for watching.
Keep on practicing.
Keep on moving forward and you are bound to succeed.
I'll see you next time.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.