1 00:00:00,580 --> 00:00:05,680 Hey, long time no see, it's it's been a while, but I'm glad you're back and I'm I'm glad you're still 2 00:00:05,680 --> 00:00:07,240 hanging in there, trust me. 3 00:00:07,270 --> 00:00:11,710 Thinks things are going to get a lot more fun once we actually start building applications. 4 00:00:11,710 --> 00:00:13,810 But we do have to go through the basics. 5 00:00:13,810 --> 00:00:15,000 So hang in there. 6 00:00:15,640 --> 00:00:23,080 Now, you may have heard me mention methods and functions before, and I briefly touched on the subject. 7 00:00:23,080 --> 00:00:23,410 Right. 8 00:00:23,740 --> 00:00:27,700 We have functions like list print. 9 00:00:28,120 --> 00:00:32,980 We have things like Max, man, what else do we have? 10 00:00:32,980 --> 00:00:34,060 We have input. 11 00:00:34,330 --> 00:00:37,840 These are all built in functions in Python. 12 00:00:38,320 --> 00:00:40,840 Python just comes with this and we're able to use them. 13 00:00:41,230 --> 00:00:47,110 And we also learned about functions that we can create ourselves custom functions like, well, some 14 00:00:47,620 --> 00:00:48,370 random. 15 00:00:49,570 --> 00:00:55,930 Stuff and I just created a function that does absolutely nothing I can just pass through. 16 00:00:57,180 --> 00:01:05,550 And these are all functions, because the way we call them is, well, we say some random stuff and 17 00:01:05,550 --> 00:01:09,870 then we call it with the brackets and give it some sort of data or leave it empty. 18 00:01:11,670 --> 00:01:18,840 But we also learned about methods and methods were different because the way we used them was using 19 00:01:18,840 --> 00:01:22,150 the dot notation, we said dot something. 20 00:01:22,170 --> 00:01:23,640 For example, if we had a string. 21 00:01:23,640 --> 00:01:24,210 Hello? 22 00:01:25,620 --> 00:01:36,660 And I do Dot, I get a list of all these methods that the string data type can use, these aren't things 23 00:01:36,660 --> 00:01:42,450 that we can use like this, because if I do capitalize. 24 00:01:45,120 --> 00:01:50,160 Like this, well, it's going to give me an air, it's going to say. 25 00:01:51,480 --> 00:01:56,670 Well, I'm going to get in there with Max because it's expecting an argument here, but let's comment 26 00:01:56,670 --> 00:01:59,160 this out and click run again. 27 00:02:00,190 --> 00:02:08,230 I get name capitals is not defined because it's not a function, it's a method, and then method has 28 00:02:08,230 --> 00:02:09,880 to be owned by something. 29 00:02:10,480 --> 00:02:12,250 And who owns a method? 30 00:02:12,430 --> 00:02:17,050 Well, whatever is to the left of the DOT, in our case, the string. 31 00:02:18,640 --> 00:02:20,950 Owns the method capitalized. 32 00:02:22,440 --> 00:02:31,770 And that's what methods are there, builtin objects that have methods such as string's dictionaries, 33 00:02:32,130 --> 00:02:39,600 sets, tuples, all the things we've talked about, where as soon as we do DOT, we have access to all 34 00:02:39,600 --> 00:02:40,260 these methods. 35 00:02:40,470 --> 00:02:44,570 They're owned by an object or a data type. 36 00:02:45,030 --> 00:02:50,850 And the funny thing is that there's ways to build your own methods. 37 00:02:51,180 --> 00:02:53,110 And I'll show you how to do that later on. 38 00:02:53,110 --> 00:02:59,100 And when we start talking about classes, but you can see here the our editors help us determine what 39 00:02:59,100 --> 00:03:00,700 type of methods that we can use. 40 00:03:01,020 --> 00:03:03,620 And again, these are built into Python. 41 00:03:04,170 --> 00:03:11,340 And you can also learn about these methods that we can use by going to the Python documentation. 42 00:03:11,340 --> 00:03:11,550 Right. 43 00:03:11,610 --> 00:03:17,280 Python three documentation is going to have a ton of things for us. 44 00:03:17,700 --> 00:03:22,690 If we go to library reference, for example, we can see here that we can learn about built in types. 45 00:03:22,710 --> 00:03:25,860 So let's go to let's go to the set types. 46 00:03:26,400 --> 00:03:31,490 And here you can see that we have set type and it shows us how we can use it. 47 00:03:31,620 --> 00:03:37,020 Now, Python doesn't have the easiest documentation to read for beginners, unfortunately. 48 00:03:37,260 --> 00:03:44,280 So sometimes it's better to actually just Google instead of going through the actual documentation. 49 00:03:44,430 --> 00:03:50,910 But you see here that the set type has clear has pop has removed. 50 00:03:51,000 --> 00:03:55,620 If we want to use it, we have update and these are the methods that we can use. 51 00:03:57,040 --> 00:04:05,830 But at the end of the day, both methods and functions allow us to take actions, right, to take actions 52 00:04:05,830 --> 00:04:09,220 on our data types, to have our programs do something. 53 00:04:09,680 --> 00:04:15,160 And although they have these different names and one has a dot in front of it and another one, while 54 00:04:15,160 --> 00:04:16,510 we can just call it like this. 55 00:04:17,290 --> 00:04:19,260 The difference is very minimal. 56 00:04:19,390 --> 00:04:20,560 But keep that in mind. 57 00:04:20,560 --> 00:04:24,520 When you hear people talking about methods and functions, there is that difference. 58 00:04:24,530 --> 00:04:29,650 And like I said before, we will get to methods when we talk about classes to show you how we can create 59 00:04:29,830 --> 00:04:30,250 our own. 60 00:04:30,880 --> 00:04:31,720 I'll see in the next one.