﻿1
00:00:01,320 --> 00:00:06,150
‫Now let's move on to two apples to apples, another data type.

2
00:00:06,870 --> 00:00:08,280
‫Sorted by Python.

3
00:00:15,460 --> 00:00:21,700
‫So balls are just like list, except that they cannot be modified once created.

4
00:00:22,870 --> 00:00:25,980
‫That's why we call them tables.

5
00:00:25,990 --> 00:00:31,270
‫So tables are tables and a list is table.

6
00:00:32,800 --> 00:00:37,830
‫So to assign a table, we use parenthesis.

7
00:00:38,170 --> 00:00:41,290
‫So for lists, we use a square record.

8
00:00:41,290 --> 00:00:44,140
‫For tables, we use parenthesis.

9
00:00:44,150 --> 00:00:46,210
‫So if we write the one.

10
00:00:47,540 --> 00:00:49,970
‫Equal to parenthesis.

11
00:00:50,780 --> 00:00:51,950
‫One, comma two.

12
00:00:58,680 --> 00:01:06,540
‫So if you see, when we were outputting the lists, there were a square record at the end and at the

13
00:01:06,540 --> 00:01:07,170
‫start.

14
00:01:07,560 --> 00:01:15,690
‫But for the tuples we have parenthesis and we cannot change the values of this element's.

15
00:01:17,570 --> 00:01:23,780
‫So just to try, if we want to change the value of this element, we can write even.

16
00:01:26,410 --> 00:01:31,270
‫Then square record zero equal to five.

17
00:01:32,440 --> 00:01:33,970
‫Since this is a table.

18
00:01:34,240 --> 00:01:42,580
‫We we'll get an error while running this so you can see the error is the object does not support item

19
00:01:42,580 --> 00:01:43,120
‫assignment.

20
00:01:43,120 --> 00:01:50,340
‫You cannot change the value of table once created to get the type of this table type.

21
00:01:50,350 --> 00:01:53,450
‫Even you can see the type is table.

22
00:01:55,260 --> 00:02:01,770
‫There are very limited use cases of temples, and we will hardly use temples in our analysis.

23
00:02:01,770 --> 00:02:05,880
‫So let's move on to the next data type, which is dictionary.

24
00:02:12,380 --> 00:02:21,350
‫Dictionaries are also like lists, except that each element is a key value pair and the syntax for assigning

25
00:02:21,350 --> 00:02:25,310
‫dictionaries is using brackets in the list.

26
00:02:25,790 --> 00:02:31,700
‫We use a square record and we use parentheses in dictionaries.

27
00:02:31,700 --> 00:02:33,530
‫We will use brackets.

28
00:02:34,210 --> 00:02:35,950
‫So in the list.

29
00:02:37,030 --> 00:02:41,200
‫There are indexes starting from zero one, two, three, four.

30
00:02:41,230 --> 00:02:45,940
‫Here you can say that you are assigning this indexes on your own.

31
00:02:45,940 --> 00:02:50,980
‫So for each element you have to assign an index which we call a key.

32
00:02:51,310 --> 00:02:53,920
‫And the element is called this value.

33
00:02:53,950 --> 00:02:58,600
‫That's why we define dictionaries as a collection of key value pairs.

34
00:02:59,290 --> 00:03:03,250
‫So to assign the variable, be one.

35
00:03:04,970 --> 00:03:08,090
‫Which is a dictionary will write equal to curly brackets.

36
00:03:08,880 --> 00:03:09,590
‫Now here.

37
00:03:09,600 --> 00:03:16,830
‫First we have to write the key, key one and then write colon.

38
00:03:16,830 --> 00:03:20,370
‫And the value of this key, which is one.

39
00:03:22,150 --> 00:03:24,730
‫Goma due to.

40
00:03:29,590 --> 00:03:33,910
‫So in the list there were indexes zero one, two, three, four.

41
00:03:33,940 --> 00:03:37,960
‫This key one key two key three are just like indexes.

42
00:03:45,550 --> 00:03:47,140
‫See this?

43
00:03:50,150 --> 00:03:52,210
‫But I do want to run this.

44
00:03:52,220 --> 00:03:53,120
‫You can see.

45
00:03:54,830 --> 00:03:55,400
‫And this.

46
00:03:55,400 --> 00:03:57,440
‫We were only getting the values.

47
00:03:57,590 --> 00:04:01,850
‫And here we are getting first the keys and then the value.

48
00:04:02,810 --> 00:04:08,060
‫So if you want, you can see the type of this D one, right?

49
00:04:08,120 --> 00:04:10,280
‫Type B one.

50
00:04:12,540 --> 00:04:14,370
‫The typist dictionary.

51
00:04:15,360 --> 00:04:19,950
‫Now, if I want to grab the first value, I will write one.

52
00:04:21,990 --> 00:04:23,640
‫And in a square bracket.

53
00:04:23,880 --> 00:04:25,620
‫I will write even.

54
00:04:29,990 --> 00:04:31,070
‫If we run this.

55
00:04:32,550 --> 00:04:33,450
‫You can see.

56
00:04:34,560 --> 00:04:42,720
‫For the key, given we have a value of one in the list we were using directly using the indexes such

57
00:04:42,720 --> 00:04:44,370
‫as zero one, two, three, four.

58
00:04:45,270 --> 00:04:46,140
‫In dictionaries.

59
00:04:46,140 --> 00:04:50,160
‫We have to use these keys to get the value of that pair.

60
00:04:54,150 --> 00:05:00,120
‫So if I tried to write like this one square record zero, that is the first element.

61
00:05:00,120 --> 00:05:01,290
‫I will get an error.

62
00:05:01,860 --> 00:05:05,790
‫I always have to refer to this value using the key of this value.

63
00:05:11,860 --> 00:05:22,360
‫So Python also supports conditional statements such as if ls or else if, and it also supports loops

64
00:05:22,360 --> 00:05:24,580
‫such as for loop and wide loop.

65
00:05:24,850 --> 00:05:27,040
‫We are not going to discuss this here.

66
00:05:27,220 --> 00:05:31,240
‫If you want, you can explore this on your own.

67
00:05:32,160 --> 00:05:32,820
‫If needed.

68
00:05:32,820 --> 00:05:36,270
‫We will discuss it in our upcoming lectures.

