1 00:00:00,530 --> 00:00:01,040 Hello guys. 2 00:00:01,060 --> 00:00:08,030 Welcome back to another class of our course but the complete introduction to Python showing today's 3 00:00:08,040 --> 00:00:12,100 class we are going to still talk about lists. 4 00:00:12,300 --> 00:00:13,790 We talked about lists. 5 00:00:13,800 --> 00:00:16,320 We talked about list list functions and everything. 6 00:00:16,440 --> 00:00:21,210 And did they score this topic will be a bit in the same. 7 00:00:21,210 --> 00:00:26,220 Well we are going to talk where we are still going to talk about lists but we are going to talk about 8 00:00:26,490 --> 00:00:28,410 a little bit different type of lists. 9 00:00:29,040 --> 00:00:32,400 And in this case it will be couples. 10 00:00:32,520 --> 00:00:40,350 So to understand what is the difference between a normal list and a normal table and a table I will 11 00:00:41,160 --> 00:00:42,990 simply write down a list right here. 12 00:00:43,230 --> 00:00:46,160 So let's say we are creating a list of colors. 13 00:00:46,200 --> 00:00:50,190 So in this case we'll write down let's say red 14 00:00:53,380 --> 00:00:55,180 then write down yellow 15 00:00:58,520 --> 00:00:59,520 and we'll write down. 16 00:00:59,960 --> 00:01:00,160 All right. 17 00:01:00,170 --> 00:01:05,250 So we have our tree colors and what we can do with this list. 18 00:01:05,270 --> 00:01:14,340 Well we can run the app so you can see works works perfectly just print it to make you run. 19 00:01:14,640 --> 00:01:18,000 So we print our list. 20 00:01:18,000 --> 00:01:18,330 All right. 21 00:01:18,330 --> 00:01:23,700 If we run it as you can see works perfectly we can do many things what we can for example if we want 22 00:01:23,700 --> 00:01:30,480 to insert something we can insert so we can write down insert and let's say I want to insert something 23 00:01:30,510 --> 00:01:36,700 at the segment the column so let's say I want to consider pink. 24 00:01:37,470 --> 00:01:37,810 All right. 25 00:01:38,050 --> 00:01:39,280 I run my app. 26 00:01:39,550 --> 00:01:40,470 It will work perfectly. 27 00:01:40,930 --> 00:01:47,380 But when I have it's awful what's the difference between a list and it's Apple is that I can play with 28 00:01:47,680 --> 00:01:54,640 all the things that I have in my list but when I have a table for example I can modify it at all. 29 00:01:54,640 --> 00:02:01,720 So let's say for example with a list I can insert I can insert new colors I can delete colors I can 30 00:02:01,720 --> 00:02:08,560 what I can do I can do well I can do many things but with topples I just can't modify it I can't add 31 00:02:08,560 --> 00:02:12,760 nothing I can delete nothing and I have to respect. 32 00:02:12,910 --> 00:02:15,320 Well it's the it Apple. 33 00:02:15,340 --> 00:02:19,130 It's simply a list that you can't modify. 34 00:02:19,240 --> 00:02:24,950 You can put topples into lists but you can't modify topples by themselves. 35 00:02:25,000 --> 00:02:26,680 So we just show you a quick example. 36 00:02:26,680 --> 00:02:28,770 So right now this is our list. 37 00:02:29,950 --> 00:02:34,960 So when we want to write it's up on how we write that topic at first I'll write it down the same way 38 00:02:35,050 --> 00:02:36,640 as we write a list. 39 00:02:36,640 --> 00:02:43,170 So when you write the list we write let's say for example write down colors so we'll click on equal 40 00:02:43,660 --> 00:02:50,800 and we will use those parentheses right here for example we'll use the basic parentheses and we will 41 00:02:50,860 --> 00:02:52,240 let's say write down our colors. 42 00:02:52,240 --> 00:02:54,280 So once again we'll write down blue 43 00:02:57,130 --> 00:02:59,650 yellow and red 44 00:03:04,640 --> 00:03:05,350 and red. 45 00:03:05,360 --> 00:03:05,720 All right. 46 00:03:05,870 --> 00:03:07,730 So we have all our colors. 47 00:03:08,000 --> 00:03:10,460 If we print if we run our app. 48 00:03:10,520 --> 00:03:20,900 So once again we run our app which will run our colors so works perfectly we have our colors right here. 49 00:03:20,920 --> 00:03:22,780 But let's say for example I want to add something. 50 00:03:22,780 --> 00:03:27,340 So in this case I want to insert so I'll write down my insert function 51 00:03:30,370 --> 00:03:37,110 I want to insert something at the second place 0 0 1 2 right here instead of red. 52 00:03:37,330 --> 00:03:38,210 I want to add. 53 00:03:38,230 --> 00:03:43,260 Let's say I want to add the black. 54 00:03:43,330 --> 00:03:43,740 All right. 55 00:03:44,140 --> 00:03:46,360 I run my app and look exactly what's going to happen. 56 00:03:46,360 --> 00:03:53,150 So as you can see I have an error message and it's written right here topples object that has not achieved 57 00:03:53,300 --> 00:03:54,290 youth in sir. 58 00:03:54,400 --> 00:03:55,730 So you just can't modify it. 59 00:03:55,750 --> 00:03:57,370 You can't use it. 60 00:03:57,490 --> 00:04:01,220 You can't use no modifications in two couples. 61 00:04:01,300 --> 00:04:08,010 And as I explained you can have a list of tables so let's say for example right here I have colors let's 62 00:04:08,020 --> 00:04:10,360 say I'll Have Another. 63 00:04:10,810 --> 00:04:12,330 Another couple of. 64 00:04:12,370 --> 00:04:14,020 In this case shapes. 65 00:04:14,020 --> 00:04:27,190 So I'll have for example square I have a triangle and I will have a circle. 66 00:04:27,250 --> 00:04:27,620 All right. 67 00:04:27,970 --> 00:04:29,890 So I have my shapes and I have my colors. 68 00:04:29,890 --> 00:04:32,640 Now let's say I want to create a list of those couples. 69 00:04:32,650 --> 00:04:42,340 So in this case I can write down let's say list and what I want to do is simply add colors 70 00:04:48,450 --> 00:04:55,650 and shapes so my list will be will be constituted with colors and shapes. 71 00:04:57,120 --> 00:05:00,670 And if I run it just print everything 72 00:05:07,040 --> 00:05:07,880 presidency. 73 00:05:08,110 --> 00:05:13,860 I have my couple that will have blue yellow red and my shapes as well. 74 00:05:13,860 --> 00:05:19,290 So as you can see my list will have the couples that are that are here. 75 00:05:19,450 --> 00:05:20,680 So I have a list of top. 76 00:05:20,710 --> 00:05:27,190 So it's possible to create a list of top all but it's very important guys that you understand that the 77 00:05:27,190 --> 00:05:32,950 main difference between couples and lists is simply that couples can be changed. 78 00:05:32,950 --> 00:05:33,280 OK. 79 00:05:33,310 --> 00:05:37,730 Right now in what exactly and what exact moment can you guys. 80 00:05:38,980 --> 00:05:43,960 Well what exact moment can you guys guess when you can only use doubles but not a list. 81 00:05:44,740 --> 00:05:49,680 So basically you want to use couples on things that you know will never ever ever change. 82 00:05:49,690 --> 00:05:55,980 So let's say for example you want to you want to look for the address of someone. 83 00:05:55,990 --> 00:05:58,350 So the address of this person will. 84 00:05:58,690 --> 00:06:06,300 Well it can change but it will not necessarily change in the near future or something even let's say 85 00:06:07,020 --> 00:06:08,050 easier. 86 00:06:08,230 --> 00:06:13,780 You want to look for the coordinates of a place in the world let's say you want to look for the coordinates 87 00:06:13,870 --> 00:06:19,310 of a mountain or at a certain county a country or a certain city. 88 00:06:19,330 --> 00:06:23,500 Well you know that those coordinates will never change. 89 00:06:23,530 --> 00:06:31,160 So you can store those and two tables so let's say we want to store one of those into couples. 90 00:06:31,290 --> 00:06:36,980 So in this case we'll write down let's say for example a city let's let's say Paris. 91 00:06:37,080 --> 00:06:41,730 So we have pirates Paris called coordinates. 92 00:06:41,730 --> 00:06:46,190 So equal and let's say Write down the coordinates of Paris. 93 00:06:46,240 --> 00:06:52,230 Once again let's say the coordinates of Paris will be 135 124. 94 00:06:52,230 --> 00:06:54,960 Once again it's just an example. 95 00:06:54,960 --> 00:06:58,500 And as you can see it's it will never it will never change. 96 00:06:58,560 --> 00:07:04,550 Let's say you want to store the ad in the IP address of something we're out of a place. 97 00:07:04,560 --> 00:07:12,420 Or just store the address IP of a certain device while you will store it in a temple because a IP address 98 00:07:12,600 --> 00:07:17,480 will not change or you don't want it to change at least as a. 99 00:07:17,900 --> 00:07:18,730 You don't want to change. 100 00:07:18,990 --> 00:07:24,330 So you have things that you never want to change everything that you guys think will never change or 101 00:07:24,420 --> 00:07:25,770 you don't want it to change. 102 00:07:25,770 --> 00:07:31,230 You store it into a couple and everything that will change so it could be variables we can store those 103 00:07:31,350 --> 00:07:32,450 into a list. 104 00:07:32,460 --> 00:07:33,990 So this is the main difference. 105 00:07:33,990 --> 00:07:36,320 So that's it for this class guys right now you understand. 106 00:07:36,390 --> 00:07:43,340 You know another type of list which are couples and you'll see it's going to be very useful for our 107 00:07:43,370 --> 00:07:44,430 by learning. 108 00:07:44,490 --> 00:07:45,700 So that's it for this class guys. 109 00:07:45,720 --> 00:07:47,490 And see all in our next class.