Hello and welcome to the golden programming language course in the previous session, we talked about
creative stories using this nicely try and indecision.
We want to talk about the other slices concept.
Create a slice using an array.
As beyond, and in no doubt, this lies is the reference of the NRA, so you can create this lines from
the given Harry for creating a sly spin on the given Harry.
First, you need to specify the lower and upper bound, which means a slice can take elements from the
areas starting from the lower bound to the upper bound.
It does not include the elements about from the upper bound, as shown in the below syntax new lines.
Column equals calls add a name and Esquire brackets low column high.
These think tanks will return a new and slice.
The default value of the lower bound is zero and the default value of the upper bound is the total number
of the elements present in the given area.
Now go to be a good program to illustrate how to create the slices from the array first created at a
high rate.
Column he calls this group where I could sit five for the last and tight end and Inshallah is the value
on two, three, four and five.
Now we want to create some slices from the given at a first, create a slice by the vacuole.
Go to the next line for the example that is slice one.
He calls early S-Corp bracket one, Colleen two, and create either a slices by shorthand declaration
for the example slice two columns equals Rey high square bracket zero column.
And in the next line, they slice three column equals a square bracket.
Column two.
And in the next line is slice for column equals every square brackets and set just column.
Now displayed, they created Annie and Slices by the following codes for the example RFP array.
Colin said the variable array
FP slice from Colin and said the variable as low as far
as close to column and slice two and displays a slice three, sets the variable slice three and pins
a slice for column and set the variable slice for save the project.
Now execute the code.
OK, we can see the output.
First, we print the created array, which contains the values one, two five and then a slice vong,
which is Thors, the first index of the array and contains the value to then a slice to each contains
the index zero to the end.
Nic stopped at eight and hold the values one to five.
Now Slice three, which contains the zero index of the array to the second index and holds the value
von N2.
And finally, the force is nice that holds all the values of the ADI and we could define the slices
using array.
In order not to prolong the time of decision, we will finish it and we will continue the content in
the next session.
Goodbye.