WEBVTT 00:00.740 --> 00:05.890 This legend let us take a deep dive with arguments so arguments are forte. 00:06.070 --> 00:08.530 The first one is positional argument. 00:08.530 --> 00:10.680 Second one is the word argument. 00:10.690 --> 00:16.210 Third one is the fourth argument and fourth one is variable length argument. 00:16.240 --> 00:21.300 So these are pretty simple and all you have to do is understand the concepts. 00:21.370 --> 00:26.800 If you are able to understand them you can write some pretty good functions pretty easily. 00:26.800 --> 00:29.560 So the first one is judicial argument. 00:29.680 --> 00:34.660 That means if I'm calling a function and I have a pattern of item and price. 00:34.840 --> 00:38.450 So these are in position type when calling the function. 00:38.470 --> 00:39.670 I have to past. 00:39.700 --> 00:41.730 I don't force them plays. 00:41.800 --> 00:48.290 In this example I write a pretty simple function that is sharp and it is accepting to bet on meterstick 00:48.310 --> 00:51.310 this item and price and then printing them. 00:51.310 --> 00:53.010 So I call this particular function. 00:53.020 --> 00:56.530 Now I have to pass them in that same sequence. 00:56.530 --> 00:57.670 So I have to pass. 00:57.670 --> 01:00.050 I don't post and then price. 01:00.220 --> 01:03.800 And if I run this function I'm going to get this simple reason. 01:04.330 --> 01:07.510 You see I got my item and sugar and prizes 50. 01:07.540 --> 01:12.090 So that means if I try to pass these in a different order 01:16.340 --> 01:21.940 and try to run this come on you can see my result is totally miss. 01:21.980 --> 01:24.750 Now my item is 15 prizes. 01:24.980 --> 01:32.450 That means the positional argument I have to parse them in a particular sequence to overcome this problem 01:32.570 --> 01:34.590 we have keyword arguments. 01:34.640 --> 01:41.060 That means while calling this particular function I just find that this is a particular paramita for 01:41.200 --> 01:42.080 boxing. 01:42.080 --> 01:45.330 That means I can find this particular argument. 01:45.530 --> 01:50.830 As for praise and this particular argument is for item. 01:50.960 --> 01:54.580 So I can define them by calling this particular function. 01:54.920 --> 01:59.760 So over here run this function you can see the result is in a proper manner. 01:59.780 --> 02:02.950 So all I have done is define that particular keyword. 02:03.140 --> 02:06.300 So this is going to solve a lot of problem. 02:06.320 --> 02:09.680 Now we need to talk about this default argument. 02:09.800 --> 02:15.360 So the default argument we need to mention a default value for up at a meter. 02:15.470 --> 02:18.960 That means I can mention a value for this particular price. 02:19.130 --> 02:25.970 So if I do that at 60 and now if I'm not passing any value for that particular price it is going to 02:25.970 --> 02:27.550 take about 60. 02:27.560 --> 02:31.560 So if I run this you can see item in sugar and prizes 60. 02:31.700 --> 02:39.500 But if I try to pass any value for that and try to run this on again you can see I scored a particular 02:39.500 --> 02:41.050 value which I've lost. 02:41.180 --> 02:47.030 That means my default argument if there is a new value missing it would take that particular default 02:47.030 --> 02:47.870 value. 02:48.050 --> 02:51.810 So maybe there is a default value for shugar 60. 02:51.860 --> 02:56.270 And if I'm not passing any value it will take 60 every day. 02:56.450 --> 03:01.560 But if I'm passing a value from my inside the function it will be my value. 03:01.660 --> 03:08.610 Now things were going well because we have two better meters and we are passing only two arguments. 03:08.660 --> 03:11.290 That means we are passing two values. 03:11.540 --> 03:17.710 But the next thing when you talk about is variable length arguments now things will be changed. 03:17.750 --> 03:20.890 And this is the important point that you need to understand. 03:22.500 --> 03:25.890 I'm taking a new example for variable length argument. 03:26.070 --> 03:29.670 So in this example I'm taking student name it's class. 03:29.670 --> 03:36.040 I know there is a difference in the spelling of class because spelling of class is itself a key word. 03:36.170 --> 03:39.110 So I cannot not use that term using this list. 03:39.320 --> 03:41.560 So I'm beginning class and Mark. 03:41.820 --> 03:49.200 So what if I need to pause name Claassen marks not just to like I'm using my name as Shavon Klaas's 03:49.210 --> 03:50.830 stem and Marks's 90. 03:50.850 --> 03:52.740 OK and me on this one. 03:52.740 --> 03:57.900 Things are going well because our variable length is similar. 03:57.900 --> 03:59.570 Let me change something. 03:59.610 --> 04:03.480 What if I need to pass marks of three subjects. 04:03.570 --> 04:06.490 So what I can do is use this trick. 04:06.600 --> 04:12.030 That means I'm telling the function that there can be many values for this particular argument. 04:12.250 --> 04:17.150 So now if I ask any number of values it would be taken into Marks. 04:17.400 --> 04:25.830 So my own value in two names my and that is my class will be in the class and all the other values will 04:25.830 --> 04:31.670 be inside my marks and if I run this one you can see a decisive stopper. 04:31.890 --> 04:38.670 So what actually happened is my shoeman value is in Ghoneim then is in the class and all the remaining 04:38.670 --> 04:40.780 values are in to my mosque. 04:40.800 --> 04:43.860 That means I'm using multiple Igle events. 04:43.980 --> 04:50.870 So I'm parsing three values at a time and they see inside marks and it is the desk top on. 04:51.150 --> 05:00.620 Most importantly if any point of time I want to print not I have to use my four Let me call and this 05:00.620 --> 05:06.040 one is just plain X.. 05:06.320 --> 05:10.300 You can see what actually happened near miss splendored classes Sprint did. 05:10.400 --> 05:17.600 And then with the help of my form new I'm using iteration inside the double and printing them that's 05:17.600 --> 05:18.060 good. 05:18.140 --> 05:22.460 We have now multiple arguments for a single Cuber that is for a mosque. 05:22.460 --> 05:26.670 We have three values and you can pass any number of values. 05:26.690 --> 05:33.260 Now the next thing I need to talk about is multiple keywords multiple keyword means in the previous 05:33.290 --> 05:36.050 example we were mentioning I'm human. 05:36.290 --> 05:43.370 I have to mention name as Shavon then my class and now I can also define all these value to a particular 05:43.370 --> 05:44.110 subject. 05:44.240 --> 05:46.930 I can define this as English. 05:47.330 --> 05:50.750 Don't worry it will be taken care of by Mock's itself. 05:51.470 --> 05:54.680 My maps and my physics. 05:54.680 --> 06:02.420 Now don't forget to add another Estrich that means you're using multiple keywords in the previous example 06:02.420 --> 06:04.420 we were using multiple values. 06:04.490 --> 06:09.810 Now we are using multiple keywords so the result will not be as a top. 06:09.890 --> 06:13.460 This result will be as our dictionary. 06:13.550 --> 06:16.710 Let me on this one. 06:16.880 --> 06:20.150 So what actually happened is I post my name. 06:20.170 --> 06:21.100 It is printed. 06:21.130 --> 06:22.200 I pass my class. 06:22.210 --> 06:27.550 It is printed Now these three are sealed as stationery inside my marks. 06:27.640 --> 06:35.280 So while printing this what actually happened is it printed my key to print my value or to print my 06:35.290 --> 06:36.570 key envelope. 06:36.760 --> 06:38.680 I have to use or does it matter. 06:38.830 --> 06:43.590 But before that let me come in this one and print here 06:47.400 --> 06:55.180 you can check out my new Meshullam classes and my mocs is as this be in the previous example it was 06:55.180 --> 06:58.380 as double so to print it isn't fun. 06:58.370 --> 06:59.220 Dictionary. 06:59.280 --> 07:07.960 All I have to do is use my Keaveney pair x in my I to give all the items here and with my ex. 07:07.980 --> 07:11.750 I also have to print my why things look good. 07:11.850 --> 07:16.290 Let me clear this out then this one you can see. 07:16.300 --> 07:20.980 Now I have named Meshullam class and then all the other marks. 07:21.010 --> 07:23.230 I can also do more experiment. 07:23.500 --> 07:31.810 Maybe use a capital letter for parsing my key words and instead of printing my marks here I can use 07:31.810 --> 07:40.060 my key here and just parse that and do so what I'm going to get this English then call on my 07:44.760 --> 07:46.600 help me on this one. 07:50.940 --> 07:56.280 I hope the result is called Name class Inishmaan my smock and X marks. 07:56.490 --> 07:58.070 So this looks worse. 07:58.190 --> 08:00.710 Going to do a lot more experiment with function. 08:00.990 --> 08:04.580 I hope no one is Styne position an argument keyword on demand. 08:04.690 --> 08:08.820 The fourth argument and also the variable length argument. 08:08.980 --> 08:15.180 So remember to use single Estrich then we are going to pass just the values without these keywords and 08:15.180 --> 08:19.100 then what you are using these words you are used to molest. 08:19.420 --> 08:25.650 The result will be an upper window keywords and the result will be inside a dictionary with keywords 08:26.070 --> 08:28.350 so that's all for this picture in the next lecture. 08:28.350 --> 08:33.700 We are going to packable type of variable with the function situation.