WEBVTT

00:03.640 --> 00:05.080
Okay.

00:05.080 --> 00:05.920
Welcome back.

00:06.600 --> 00:12.520
Now it is time to go and start learning something about list in Python.

00:13.560 --> 00:16.520
Okay, let's create a list of py.

00:16.800 --> 00:18.280
Now we have it here.

00:18.320 --> 00:18.760
Okay.

00:19.360 --> 00:23.400
List is another type of thing.

00:23.440 --> 00:25.280
Another type in Python.

00:25.320 --> 00:25.960
Okay.

00:26.000 --> 00:28.800
So how can we create a list in Python.

00:29.240 --> 00:31.680
So let's create a variable first.

00:31.720 --> 00:38.720
Let's name it name or list I don't know how to name it.

00:38.760 --> 00:41.400
Let's name it is equal to.

00:42.280 --> 00:45.880
So in list we use square bracket okay.

00:46.880 --> 00:49.720
So here I'm going to give some names.

00:49.720 --> 00:51.360
For example name add.

00:56.720 --> 01:00.200
And then use comma to separate each value.

01:00.240 --> 01:02.080
The next one is going to be John.

01:02.280 --> 01:06.120
Next one is going to be Ali okay.

01:06.120 --> 01:09.640
Right now our list has three value.

01:10.120 --> 01:12.880
So I want to print all the values.

01:13.040 --> 01:17.750
So I use print and then names and then hit It control.

01:17.790 --> 01:24.310
Is this camera in here and use Python list.py.

01:24.350 --> 01:28.670
Right now you see we have all everything right here.

01:28.710 --> 01:32.310
Okay so this is one way that we can print this.

01:32.950 --> 01:38.310
And remember lists in Python lists are indexed.

01:38.350 --> 01:39.150
Okay.

01:39.190 --> 01:41.390
So this has index number zero.

01:41.670 --> 01:43.470
This one has index number one.

01:43.470 --> 01:45.230
This has index number two.

01:45.710 --> 01:48.390
So here I am going to specify that okay.

01:48.430 --> 01:53.510
So let's use number one I want to print the first one or the second one okay second one.

01:53.510 --> 01:56.670
And let's see which one is going to be printed.

01:56.670 --> 01:58.070
So you see it has gone.

01:58.270 --> 02:01.710
Now if I use zero.

02:04.550 --> 02:09.110
And here you see it is giving me name okay.

02:09.510 --> 02:11.110
So what if I want to.

02:12.670 --> 02:16.710
And from zero up to two okay.

02:16.710 --> 02:18.310
This is another way we can do it.

02:18.350 --> 02:21.230
It will give me zero and number one.

02:21.230 --> 02:23.630
And the last one is not going to be defined.

02:23.670 --> 02:30.630
So if you want to see number uh if you want to see only two so you need to specify that by three.

02:30.630 --> 02:32.750
So what if I don't give anything.

02:32.790 --> 02:33.630
Okay.

02:33.730 --> 02:36.570
And now you see, it is giving me all.

02:36.610 --> 02:39.050
If I have more, it will give me four.

02:39.050 --> 02:44.050
So that means we start from here and then it's continue until it's finished.

02:44.290 --> 02:48.810
And also we can do that like this too for example.

02:48.850 --> 02:54.130
Now I'm going to tell this that start from the beginning up to number three.

02:54.170 --> 02:59.490
So now it will give me all and everything if I change it back to number two.

03:01.650 --> 03:04.530
It will only give me two of them okay.

03:04.570 --> 03:05.850
Name it and John.

03:06.290 --> 03:13.050
What if I ask for the last one and now it's only giving me a list?

03:13.090 --> 03:14.890
So it is how list work.

03:14.930 --> 03:15.170
Okay.

03:15.210 --> 03:17.290
We can store a lot of things inside.

03:17.330 --> 03:17.650
List.

03:17.690 --> 03:19.530
Not just name or string.

03:19.530 --> 03:22.530
We can do a number as well.

03:23.010 --> 03:23.490
Okay.

03:24.010 --> 03:27.090
So save it and let's remove the index right now.

03:32.490 --> 03:32.970
Okay.

03:32.970 --> 03:38.730
Now you see we have named John Li one two and two three.

03:38.730 --> 03:42.250
So that is how it works.

03:42.250 --> 03:43.770
That is called list.

03:43.810 --> 03:46.410
So let's go and see what is tuple.

03:46.410 --> 03:47.490
And also what is it.

03:47.530 --> 03:48.370
What is a dictionary.

03:48.370 --> 03:50.410
And a lot of thing okay.

03:50.450 --> 03:50.970
See you.
