1
00:00:08,000 --> 00:00:14,220
Welcome back. So were strings like S are sequences of characters,

2
00:00:14,220 --> 00:00:19,469
lists are a new kind of Python type which are sequences of any type of value,

3
00:00:19,469 --> 00:00:22,620
which can include other strings or lists.

4
00:00:22,620 --> 00:00:28,605
So lists are created by using square brackets.

5
00:00:28,605 --> 00:00:32,355
I start creating a list by using a left square bracket,

6
00:00:32,355 --> 00:00:35,625
and then I put my contents separated by commas.

7
00:00:35,625 --> 00:00:38,730
Here I'll make the first item actually be a string.

8
00:00:38,730 --> 00:00:41,955
I'll make the second item be an integer,

9
00:00:41,955 --> 00:00:45,760
and I'll make the third item be another string.

10
00:00:49,100 --> 00:00:52,510
When I print out my list,

11
00:00:53,880 --> 00:00:58,840
then I get back the items that I actually put into the list.

12
00:00:58,840 --> 00:01:01,060
Now just like strings,

13
00:01:01,060 --> 00:01:03,950
lists have an order and a length.

14
00:01:03,950 --> 00:01:06,880
In the case of this list my list,

15
00:01:06,880 --> 00:01:09,040
then I actually have three items.

16
00:01:09,040 --> 00:01:11,935
The first item is the string one,

17
00:01:11,935 --> 00:01:15,385
and then separating out every item is a comma.

18
00:01:15,385 --> 00:01:18,855
The second item is the integer two,

19
00:01:18,855 --> 00:01:21,230
separated by a comma again,

20
00:01:21,230 --> 00:01:24,950
and the third item is the string three.

21
00:01:24,950 --> 00:01:28,645
I would say that this list has length three.

22
00:01:28,645 --> 00:01:30,200
The first item being one,

23
00:01:30,200 --> 00:01:32,005
the second item being the integer two,

24
00:01:32,005 --> 00:01:34,735
the third item being the string three.

25
00:01:34,735 --> 00:01:38,080
Here are a few other examples of lists.

26
00:01:38,080 --> 00:01:40,180
Just like I can have an empty string,

27
00:01:40,180 --> 00:01:42,455
I can also have an empty list.

28
00:01:42,455 --> 00:01:45,275
This is a list with link zero.

29
00:01:45,275 --> 00:01:49,070
I can also have a list with one item.

30
00:01:49,110 --> 00:01:53,575
Here my list is a list with one item,

31
00:01:53,575 --> 00:01:57,215
and that one item is the integer 100.

32
00:01:57,215 --> 00:01:59,910
Now just like strings,

33
00:01:59,910 --> 00:02:03,760
this my list equals the list 100 is very

34
00:02:03,760 --> 00:02:08,455
different from creating an integer I equal to 100.

35
00:02:08,455 --> 00:02:11,140
Even though these looks similar us,

36
00:02:11,140 --> 00:02:14,190
to Python these are entirely different.

37
00:02:14,190 --> 00:02:17,050
Further, if I make S the string 100,

38
00:02:17,050 --> 00:02:20,030
then all three of these are entirely different things,

39
00:02:20,030 --> 00:02:21,755
because S is a string,

40
00:02:21,755 --> 00:02:23,345
my list is the list,

41
00:02:23,345 --> 00:02:25,735
and I is an integer.

42
00:02:25,735 --> 00:02:30,215
If I tried to do something like my list plus five,

43
00:02:30,215 --> 00:02:32,645
then I would get a run time error

44
00:02:32,645 --> 00:02:37,405
saying that we can only concatenate lists with other lists,

45
00:02:37,405 --> 00:02:39,535
because my list is a list,

46
00:02:39,535 --> 00:02:42,175
the only other thing that we can add to it is a list,

47
00:02:42,175 --> 00:02:46,350
as we'll talk about it in a later lesson. Until next time.