1 00:00:00,000 --> 00:00:02,000 [no audio] 2 00:00:02,000 --> 00:00:03,100 Friends here we are going to 3 00:00:03,100 --> 00:00:06,500 discuss about the simple functions with arguments. 4 00:00:06,700 --> 00:00:08,800 Let me explain this with an example. 5 00:00:09,500 --> 00:00:11,100 Let me open my editor. 6 00:00:11,300 --> 00:00:13,600 I am taking a script name called 7 00:00:13,600 --> 00:00:16,000 'function_with_simple_arguments.py'. 8 00:00:16,399 --> 00:00:19,900 Right. See, I have a small requirement. Just 9 00:00:19,900 --> 00:00:22,700 assume that that requirement is read a number 10 00:00:22,700 --> 00:00:24,400 and increment it by 10. 11 00:00:25,700 --> 00:00:28,800 So, first I am writing without functions concept. 12 00:00:30,000 --> 00:00:31,700 Let me take 'num= 13 00:00:31,700 --> 00:00:34,110 [no audio] 14 00:00:34,100 --> 00:00:35,800 (input("Enter your number: "))'. 15 00:00:35,800 --> 00:00:39,000 [no audio] 16 00:00:39,000 --> 00:00:43,700 That's it. Then I want to find 'result=num+10'. 17 00:00:43,700 --> 00:00:46,500 [no audio] 18 00:00:46,500 --> 00:00:48,900 Then I want to print that result. 'print(" 19 00:00:48,900 --> 00:00:51,710 [no audio] 20 00:00:51,700 --> 00:00:53,100 Your result is :", 21 00:00:54,600 --> 00:00:55,600 something like that. 22 00:00:55,600 --> 00:00:56,600 You can take anything. 23 00:00:56,600 --> 00:00:58,510 [no audio] 24 00:00:58,500 --> 00:01:00,600 That's it. Right. Now, 25 00:01:00,600 --> 00:01:04,000 let me go to my command line and let me run it. Before running, 26 00:01:04,500 --> 00:01:05,500 this is your script. 27 00:01:05,700 --> 00:01:08,300 I am running this script. See the result. 28 00:01:09,200 --> 00:01:12,200 I am passing suppose some 20, then you have to get your output 29 00:01:12,200 --> 00:01:14,800 as 30. Yes, you are getting. Now, 30 00:01:14,800 --> 00:01:16,300 this is a simple Python Script. 31 00:01:16,300 --> 00:01:20,400 But what I want to do is, I want to convert this entire code 32 00:01:20,400 --> 00:01:21,700 in terms of functions. 33 00:01:22,800 --> 00:01:27,000 So, first step what I am doing is, adding 10 to your given 34 00:01:27,000 --> 00:01:30,600 number and then printing, I am writing under one function. 35 00:01:31,200 --> 00:01:34,400 Right. So, you know whenever if you want to define a function, 36 00:01:34,500 --> 00:01:41,500 yes, 'def get_result', that is suppose my function, and under this function 37 00:01:41,500 --> 00:01:45,100 I am writing these two lines, and finally simply write 38 00:01:45,100 --> 00:01:47,900 return 'None'. That's it. 39 00:01:47,900 --> 00:01:49,300 [no audio] 40 00:01:49,300 --> 00:01:55,900 Now, I am reading the, I mean I want to get my number. 41 00:01:56,000 --> 00:01:59,500 Yes, I am getting. Right. Now, 42 00:01:59,500 --> 00:02:02,700 I'm running. I am providing but you're not getting an output. 43 00:02:02,800 --> 00:02:06,300 The reason is, your logic is there under 'get_result' function, 44 00:02:06,300 --> 00:02:09,000 but you are not calling that. If you call, then only that logic 45 00:02:09,000 --> 00:02:13,000 will execute. Now, after reading a number now I want to call that logic. 46 00:02:13,000 --> 00:02:15,109 [no audio] 47 00:02:15,100 --> 00:02:16,700 Right. Now, see the code. 48 00:02:16,700 --> 00:02:18,659 [no audio] 49 00:02:18,649 --> 00:02:20,900 So, you are reading your number. After that 50 00:02:20,900 --> 00:02:24,100 you're calling your logic. Now, we will execute. Now, I am running. 51 00:02:24,100 --> 00:02:27,810 [no audio] 52 00:02:27,800 --> 00:02:30,900 I am giving some 4, you're getting result as 14. 53 00:02:32,200 --> 00:02:36,900 Right. Now, actually to read your number, and to execute your 54 00:02:36,900 --> 00:02:40,600 logic you have two lines. Now these two lines also, I want to 55 00:02:40,600 --> 00:02:42,100 write under one more function. 56 00:02:42,100 --> 00:02:43,200 Yes, you can write it. 57 00:02:44,000 --> 00:02:45,000 Let me do one thing. 58 00:02:45,000 --> 00:02:48,600 [no audio] 59 00:02:48,600 --> 00:02:54,800 'my_code', I'm taking. That's it. 60 00:02:54,800 --> 00:02:58,109 [no audio] 61 00:02:58,100 --> 00:03:01,300 Right. And I'm running. You're not getting any output. 62 00:03:02,100 --> 00:03:06,900 The reason is, now your entire logic, reading a number and 63 00:03:06,900 --> 00:03:10,800 then finding your result, both are there under two different functions, 64 00:03:10,800 --> 00:03:13,000 [no audio] 65 00:03:13,000 --> 00:03:17,200 Right. So, in your 'my_code' you are calling your, 66 00:03:17,200 --> 00:03:19,900 you're reading your number, and then you are calling this function. 67 00:03:19,900 --> 00:03:21,700 [no audio] 68 00:03:21,700 --> 00:03:25,900 Now to execute this logic, you need to call this 69 00:03:25,900 --> 00:03:27,700 function, to execute this logic 70 00:03:27,700 --> 00:03:29,600 you need to call this function, right. 71 00:03:29,600 --> 00:03:33,400 So that's why what I am doing is, somewhere I am calling 72 00:03:34,200 --> 00:03:35,800 'my_code'. That's it. 73 00:03:37,000 --> 00:03:40,800 Now, instead of 'my_code' if we take it as 'main', that's good. 74 00:03:42,100 --> 00:03:46,800 You can take any function name, but this is the simple way 75 00:03:47,100 --> 00:03:50,500 to take your function name as 'main', so that you can easily 76 00:03:50,500 --> 00:03:51,900 understand that 'main' is nothing 77 00:03:51,900 --> 00:03:54,300 but, from there you're going to execute your logic. 78 00:03:55,800 --> 00:03:58,800 So, it's not mandatory to take your function name as 'main', 79 00:03:58,800 --> 00:04:00,800 but if we take then it's good. That's it. 80 00:04:02,200 --> 00:04:05,800 Right. Now, previously we've done our code, and we are 81 00:04:05,800 --> 00:04:07,000 getting our output. Now, 82 00:04:07,000 --> 00:04:11,300 if I do that you will get an error, that is - 'num' is not defined. 83 00:04:12,200 --> 00:04:14,600 Why you're getting this error? Where you are getting this 84 00:04:14,600 --> 00:04:16,000 error? In line number 2. 85 00:04:16,000 --> 00:04:20,100 What is that? While finding 'result', this 'num' variable is unable 86 00:04:20,100 --> 00:04:21,700 to find by your Python. 87 00:04:22,200 --> 00:04:23,300 What is the reason for that? 88 00:04:23,300 --> 00:04:25,100 [no audio] 89 00:04:25,100 --> 00:04:27,700 See 'num', now it is there under 'main' function. 90 00:04:28,399 --> 00:04:30,600 It is one function, right. Under function 91 00:04:30,600 --> 00:04:31,800 you define a 'num' variable. 92 00:04:32,300 --> 00:04:35,200 Then this variable is specific to this function. 93 00:04:35,400 --> 00:04:37,200 How can you access in this way function? 94 00:04:38,800 --> 00:04:44,600 Now this 'num', this 'num' variable, right is specific to this 95 00:04:44,600 --> 00:04:45,600 'main' function, 96 00:04:46,000 --> 00:04:48,500 how can you access inside of 'get_result'? 97 00:04:48,500 --> 00:04:50,200 [no audio] 98 00:04:50,200 --> 00:04:51,500 So that's why what you have to do? 99 00:04:52,000 --> 00:04:54,800 You need to make your variable as global. 100 00:04:54,800 --> 00:04:58,409 [no audio] 101 00:04:58,400 --> 00:04:59,400 Now it will work. 102 00:04:59,400 --> 00:05:02,600 [no audio] 103 00:05:02,600 --> 00:05:07,300 But making your variables as global is not that much good. 104 00:05:07,400 --> 00:05:09,800 Whenever if you have a requirement then only we'll do that. 105 00:05:11,000 --> 00:05:15,000 A requirement means, suppose assume that 'num' variable, suppose 106 00:05:15,000 --> 00:05:16,700 in my function, in my code 107 00:05:16,700 --> 00:05:20,300 I have some 10 functions. In all functions 108 00:05:20,400 --> 00:05:21,600 I need to use suppose 109 00:05:21,600 --> 00:05:22,700 let's say 'num' variable. 110 00:05:22,700 --> 00:05:25,000 Then I can simply make it as global, 111 00:05:26,700 --> 00:05:29,200 so that I can access that 'num' variable in all the functions. 112 00:05:29,200 --> 00:05:31,310 [no audio] 113 00:05:31,300 --> 00:05:33,000 As of now, right, 114 00:05:33,100 --> 00:05:36,100 I need this 'num' variable only inside of my one function, 115 00:05:36,100 --> 00:05:37,200 'get_result' function. 116 00:05:37,700 --> 00:05:42,400 That's why, don't make your variables as global whenever if 117 00:05:42,400 --> 00:05:44,900 there is no requirement. 118 00:05:46,200 --> 00:05:48,400 If you have some specific requirement, then only we will 119 00:05:48,400 --> 00:05:49,500 make it as global. 120 00:05:49,500 --> 00:05:53,600 We will see that situation. Right. So forget about global now. 121 00:05:53,700 --> 00:05:57,100 Then how you can send your 'num' variable to this 'get_result' 122 00:05:57,100 --> 00:06:01,700 function? Simple, while calling you just pass your 'num'. 123 00:06:03,200 --> 00:06:07,600 Now you're passing your 'num' value, right. Now see that. 124 00:06:07,600 --> 00:06:10,000 I am passing that, right. But if I run that you are going 125 00:06:10,000 --> 00:06:11,600 to get an error. That is 126 00:06:13,000 --> 00:06:16,900 'get_result() takes 0 positional arguments, but 1 was given.' 127 00:06:18,200 --> 00:06:19,600 'get_result' is a function. 128 00:06:19,600 --> 00:06:21,700 [no audio] 129 00:06:21,700 --> 00:06:24,400 Right. So here 'get_result' function. Here 130 00:06:24,400 --> 00:06:27,000 nothing is there, but you are sending one value. 131 00:06:27,600 --> 00:06:30,900 So whenever if you are passing your variable value in this 132 00:06:30,900 --> 00:06:37,500 way, here also you should have some variable to store whatever 133 00:06:37,500 --> 00:06:39,100 the value coming from here. 134 00:06:39,600 --> 00:06:42,200 That means here we define a variable, right? 135 00:06:42,200 --> 00:06:45,500 Let me define here also some variable. Then it will match. 136 00:06:46,100 --> 00:06:49,400 Let me take here also 'num', but you can take any variable. 137 00:06:49,500 --> 00:06:50,800 No need to take 'num' also, 138 00:06:51,500 --> 00:06:53,600 You can take any variable like 'value'. 139 00:06:54,800 --> 00:06:59,000 Right. Now, whatever the variable you define, that variable 140 00:06:59,000 --> 00:07:00,700 is available inside of this function. 141 00:07:02,300 --> 00:07:04,600 Right. So as of now, I'm running in this way. 142 00:07:04,600 --> 00:07:06,600 [no audio] 143 00:07:06,600 --> 00:07:11,900 Yes. You are getting. But see, while calling you're passing 'num' 144 00:07:12,000 --> 00:07:13,800 means you are not passing 'num' variable, 145 00:07:13,800 --> 00:07:17,600 you are passing the value of 'num'. Guys from this line 146 00:07:18,000 --> 00:07:22,000 only the value will be passed to here, and here we are capturing 147 00:07:22,000 --> 00:07:23,900 that value in terms of 'num' variable. 148 00:07:25,200 --> 00:07:28,700 Right. Now what I am doing is I am removing, instead of 'num' 149 00:07:28,800 --> 00:07:29,900 I am taking a 'value'. 150 00:07:30,500 --> 00:07:34,000 Now this 'value' variable is available inside of this function. 151 00:07:34,100 --> 00:07:36,300 Now instead of 'num', now you have to take 'value'. 152 00:07:37,900 --> 00:07:40,300 That's it. Now see the result. 153 00:07:40,300 --> 00:07:42,100 [no audio] 154 00:07:42,100 --> 00:07:43,100 It's working. 155 00:07:44,200 --> 00:07:50,700 Right. So, if you pass your variables while calling, then that variables 156 00:07:50,700 --> 00:07:52,600 are called arguments, 157 00:07:53,800 --> 00:07:58,000 and the variable which is defined in your defined function, defined 158 00:07:58,000 --> 00:07:59,800 function means 'def' somewhere here 159 00:07:59,800 --> 00:08:05,800 it is there, no. And this variable is called parameter, parameters 160 00:08:05,800 --> 00:08:14,100 or positional arguments. Why we are calling them as a positional 161 00:08:14,100 --> 00:08:18,400 arguments? See, as of now you have only one variable. 162 00:08:18,900 --> 00:08:20,100 That's why you can't understand 163 00:08:20,100 --> 00:08:21,100 what is the position. 164 00:08:21,900 --> 00:08:24,500 Let me take simply one more code. 165 00:08:24,500 --> 00:08:26,710 [no audio] 166 00:08:26,700 --> 00:08:27,800 That is just for addition. 167 00:08:27,800 --> 00:08:33,710 [no audio] 168 00:08:33,700 --> 00:08:34,900 Let me write. Directly 169 00:08:34,900 --> 00:08:39,000 I'm writing your logic without functions. 170 00:08:39,200 --> 00:08:40,700 Let's say number 'a'. 171 00:08:40,700 --> 00:08:45,110 [no audio] 172 00:08:45,100 --> 00:08:46,500 "Enter your first number :" 173 00:08:46,500 --> 00:08:50,610 [no audio] 174 00:08:50,600 --> 00:08:51,799 Then number 'b', 175 00:08:51,799 --> 00:08:57,400 [no audio] 176 00:08:57,400 --> 00:09:00,200 "Enter your second number :". 177 00:09:00,200 --> 00:09:02,610 [no audio] 178 00:09:02,600 --> 00:09:06,700 Then I am finding 'result = a + b'. 179 00:09:07,000 --> 00:09:08,600 Then I am printing the 'result'. 180 00:09:08,600 --> 00:09:10,500 [no audio] 181 00:09:10,500 --> 00:09:12,600 "The addition of 182 00:09:12,600 --> 00:09:17,100 [no audio] 183 00:09:17,100 --> 00:09:22,600 and is :", your 'result'. 184 00:09:22,600 --> 00:09:24,910 [no audio] 185 00:09:24,900 --> 00:09:27,100 Right. First let me run it and see the output. 186 00:09:27,600 --> 00:09:30,600 I am passing 4 and 5, then you are getting the result as 9. 187 00:09:31,200 --> 00:09:33,300 Right. That's fine. 188 00:09:33,900 --> 00:09:36,500 Now, same way I want to find subtraction as well. 189 00:09:36,700 --> 00:09:41,100 Let's say this is addition result, 'aresult', then subtraction result, 'sresult' 190 00:09:41,100 --> 00:09:47,500 I am finding 'a-b'. Then I want to print, "The subtraction 191 00:09:47,500 --> 00:09:49,500 of 192 00:09:50,500 --> 00:09:52,500 and 193 00:09:53,500 --> 00:09:54,500 is :", 194 00:09:55,300 --> 00:09:56,800 'sresult'. 195 00:09:58,300 --> 00:09:59,300 That's it. 196 00:09:59,300 --> 00:10:01,300 [no audio] 197 00:10:01,300 --> 00:10:06,100 Right. 3, 4, you're getting. What happened? 198 00:10:06,100 --> 00:10:08,600 [no audio] 199 00:10:08,600 --> 00:10:10,500 Okay, here 'aresult'. 200 00:10:11,900 --> 00:10:12,900 Yeah, it's fine. 201 00:10:13,800 --> 00:10:17,800 You're getting. Right. Now, of course 202 00:10:17,800 --> 00:10:19,900 this is a logic without functions. 203 00:10:19,900 --> 00:10:25,600 But now I want to convert this into functions concept. So 204 00:10:25,600 --> 00:10:29,900 reading 'a' and 'b', right, I will do from 'main' function. 205 00:10:30,300 --> 00:10:34,700 So, I am taking this as a 'main' function. Inside of 'main' function 206 00:10:34,700 --> 00:10:36,800 I am reading my 'a' and 'b' values. 207 00:10:36,800 --> 00:10:40,900 [no audio] 208 00:10:40,900 --> 00:10:42,200 Right. Then 209 00:10:43,300 --> 00:10:47,900 I'm going to take these two lines, and I want to give the 210 00:10:47,900 --> 00:10:50,700 name for that as addition, 'get_addition'. 211 00:10:50,700 --> 00:10:57,810 [no audio] 212 00:10:57,800 --> 00:11:00,800 That's it. So I am finding for addition here. 213 00:11:00,800 --> 00:11:05,910 [no audio] 214 00:11:05,900 --> 00:11:08,100 Same way remaining two lines 215 00:11:08,100 --> 00:11:10,300 I want to write one more function, 216 00:11:10,800 --> 00:11:13,000 that is 'get_sub'. 217 00:11:13,400 --> 00:11:15,100 Let me take these two lines. 218 00:11:15,100 --> 00:11:24,210 [no audio] 219 00:11:24,200 --> 00:11:26,800 Let me write finally 'return None'. 220 00:11:27,400 --> 00:11:30,900 And in 'main' function also we have returned 'None'. Yeah, fine. Now, 221 00:11:30,900 --> 00:11:36,400 let me run it. No output because now if you observe you have 222 00:11:36,400 --> 00:11:39,100 three functions, nowhere we are calling any function, 223 00:11:39,100 --> 00:11:40,000 how it will execute? 224 00:11:40,800 --> 00:11:44,500 Right. Anyway, our intention is, our starting logic should be from 225 00:11:44,500 --> 00:11:48,900 here. That's why I need to call this 'main' after 226 00:11:48,900 --> 00:11:50,900 defining all your functions. Somewhere here 227 00:11:51,000 --> 00:11:52,000 I am calling that. 228 00:11:53,400 --> 00:11:54,400 That's it. 229 00:11:55,200 --> 00:11:56,200 Right. Now see. 230 00:11:59,000 --> 00:12:01,000 I'm running. Let me do one thing. 231 00:12:01,100 --> 00:12:02,800 I will remove empty lines. 232 00:12:02,800 --> 00:12:06,510 [no audio] 233 00:12:06,500 --> 00:12:08,900 See, this is your logic. Now, I am running that. 234 00:12:08,900 --> 00:12:11,510 [no audio] 235 00:12:11,500 --> 00:12:15,900 "Enter number", three, four. You're not getting an output. 236 00:12:15,900 --> 00:12:17,700 [no audio] 237 00:12:17,700 --> 00:12:20,500 See, we are reading 'a' and 'b' values. Where we are calling 238 00:12:20,500 --> 00:12:22,900 'get_add', 'get_result'? Nowhere we are calling. 239 00:12:22,900 --> 00:12:24,400 That's why you're not getting any output. Now, 240 00:12:24,400 --> 00:12:31,100 I want to get addition and also subtraction, then I need to 241 00:12:31,100 --> 00:12:35,800 call those functions, right. But here we'll get an error. But obseve that. 242 00:12:35,800 --> 00:12:37,800 [no audio] 243 00:12:37,800 --> 00:12:40,500 While finding addition 'a' and 'b', you are getting 244 00:12:40,500 --> 00:12:46,000 an error called, name 'a' is not defined. Why? See your 245 00:12:46,000 --> 00:12:48,700 'a' and 'b' variables are there under your 'main' function. 246 00:12:49,100 --> 00:12:50,600 That means they're local variable. 247 00:12:50,600 --> 00:12:54,300 They are specific to this 'main' function. How you can use that 248 00:12:54,300 --> 00:12:56,700 in 'get_add' function or 'get_sub' function? 249 00:12:57,900 --> 00:13:01,000 So, if you want to use those variable values you need to pass 250 00:13:01,000 --> 00:13:03,400 them to that function whenever if you are calling. 251 00:13:04,500 --> 00:13:07,600 Right. Now, 'get_add(a,b)', 252 00:13:09,000 --> 00:13:12,600 'get_sub(a,b)'. And variables, whatever the variables 253 00:13:12,600 --> 00:13:14,300 value you are sending, you need to capture here 254 00:13:14,300 --> 00:13:16,300 also. That's why in your defined function 255 00:13:16,300 --> 00:13:22,000 also you have to write 'a,b', then 'a,b'. That's it. 256 00:13:23,600 --> 00:13:25,800 Right. Now, let me run it. 257 00:13:26,200 --> 00:13:29,100 I am giving number 4 and 7, see the result. 258 00:13:29,100 --> 00:13:31,410 [no audio] 259 00:13:31,400 --> 00:13:37,600 Addition 11, subtraction -3. Now what I am doing is, while 260 00:13:37,900 --> 00:13:38,900 getting subtraction 261 00:13:38,900 --> 00:13:40,400 I am passing 'b,a'. 262 00:13:40,400 --> 00:13:42,410 [no audio] 263 00:13:42,400 --> 00:13:46,200 So previously you got result as -3 for 4 and 7. Now, 264 00:13:46,200 --> 00:13:48,900 I am running, I am giving same values, and see the result what 265 00:13:48,900 --> 00:13:50,500 you are getting. '+3' you're getting 266 00:13:51,800 --> 00:13:54,700 because we changed the position. See that. 267 00:13:56,000 --> 00:13:58,900 If we change here position, based on that position only these 268 00:13:58,900 --> 00:14:03,500 values will be assigned to your, 'b' value now you're assigning 269 00:14:03,500 --> 00:14:07,100 to 'a', 'a' value you're assigning to 'b', right. 270 00:14:07,100 --> 00:14:10,100 So based on this position you are getting values here. 271 00:14:10,700 --> 00:14:15,800 That's why these are called positional arguments or simply parameters. 272 00:14:15,800 --> 00:14:18,000 [no audio] 273 00:14:18,000 --> 00:14:23,500 Right. Now you're fine with positional arguments. Right. 274 00:14:24,500 --> 00:14:25,500 and one more thing, 275 00:14:26,500 --> 00:14:27,900 we already discussed that 276 00:14:29,500 --> 00:14:30,500 whenever if you are calling 277 00:14:30,500 --> 00:14:32,700 function, you're passing 'a' and 'b' variables, 278 00:14:33,000 --> 00:14:36,200 and we are assigning them to 'a' and 'b'. You need to understand 279 00:14:36,200 --> 00:14:40,400 here 'a' value will be assigned to this 'a', and 'b' value will 280 00:14:40,400 --> 00:14:44,300 be assigned to this 'b'. Same way this is 'a' value will be assigned 281 00:14:44,300 --> 00:14:48,500 to 'a', and this 'b' value will be assigned to 'b', and these variables 282 00:14:48,600 --> 00:14:52,000 all we are using inside of this, and this 'a' and this 'b' 283 00:14:52,200 --> 00:14:58,200 not from here, they are from this parenthesis. Be clear. This 'a', 'b' 284 00:14:58,300 --> 00:15:01,200 are from this, from this place. 285 00:15:01,600 --> 00:15:04,300 Whatever you define here that variables you can use inside 286 00:15:04,300 --> 00:15:05,300 of your function. 287 00:15:06,500 --> 00:15:10,800 Right. And while calling you're passing 'a,b' right. 288 00:15:10,900 --> 00:15:12,100 No need to take 'a,b'. 289 00:15:12,400 --> 00:15:14,300 You can take some 'p,q' also. 290 00:15:15,300 --> 00:15:17,500 Let me take 'p,q'. 291 00:15:17,800 --> 00:15:21,100 So, you're taking 'p' and 'q'. Now on there are no more 'a' and 'b'. 292 00:15:21,200 --> 00:15:23,000 Now variables are 'p' and 'q'. Now, 293 00:15:23,000 --> 00:15:26,200 you have to write your logic in terms of 'p' and 'q'. 294 00:15:26,200 --> 00:15:31,410 [no audio] 295 00:15:31,400 --> 00:15:35,400 Nowhere we have 'a' and 'b', we have only 'p' and 'q'. The same way here 296 00:15:35,400 --> 00:15:38,500 also you can take, no need to take 'a', 'b' or 'p', 'q', you can take 297 00:15:38,500 --> 00:15:40,100 some 'm, n'. No problem. 298 00:15:40,700 --> 00:15:43,300 The only thing what will happen whenever if you're calling 299 00:15:43,300 --> 00:15:46,800 your functions, we are sending the values. 300 00:15:47,100 --> 00:15:50,000 This first value will be assigned to first variable, 301 00:15:50,300 --> 00:15:52,700 second value will be assigned to second variable. Here 302 00:15:52,700 --> 00:15:57,000 also 'a' value will be assigned to 'm', 'b' value will be assigned 'n'. 303 00:15:57,800 --> 00:16:00,600 Now inside of your 'get_sub', there are no more 'a' and 304 00:16:00,600 --> 00:16:04,000 'b'. Now you have in terms of 'm' and 'n' your variables. 305 00:16:04,000 --> 00:16:06,610 [no audio] 306 00:16:06,600 --> 00:16:07,600 That's it. 307 00:16:08,300 --> 00:16:11,700 Let me modify completely, and let me run this code. You are 308 00:16:11,700 --> 00:16:14,600 going to get same results. See that. 309 00:16:14,600 --> 00:16:17,200 [no audio] 310 00:16:17,200 --> 00:16:22,600 Right. So be clear. 'a' and 'b' are specific to 'main' function, 'p' 311 00:16:22,600 --> 00:16:26,400 and 'q' are specific to 'get_add' function, 'm' and 'n' are specific 312 00:16:26,400 --> 00:16:28,100 to 'get_sub' function. 313 00:16:29,200 --> 00:16:31,400 Right. While calling in this way 314 00:16:31,500 --> 00:16:35,700 only the values will be assigned to your variables respectively. 315 00:16:36,000 --> 00:16:39,000 First value - first variable, second value - second variable. 316 00:16:39,800 --> 00:16:40,800 That's it. 317 00:16:40,800 --> 00:16:43,110 [no audio] 318 00:16:43,100 --> 00:16:50,100 Okay. Now suppose I have directly values called 9 and 10. 319 00:16:50,400 --> 00:16:52,300 I want to find the subtraction for this. 320 00:16:52,600 --> 00:16:58,400 Yes, we can find, 'get_sub(9,10)'. Directly you can provide 321 00:16:58,400 --> 00:16:59,400 your values also. 322 00:16:59,400 --> 00:17:01,700 [no audio] 323 00:17:01,700 --> 00:17:05,000 Now, if I do in this way, let me comment these two functions. 324 00:17:05,000 --> 00:17:06,900 [no audio] 325 00:17:06,900 --> 00:17:10,400 Now, I'm not reading 'a' and 'b' values. In my hand directly I 326 00:17:10,400 --> 00:17:11,700 have values 9 and 10. 327 00:17:11,700 --> 00:17:15,700 Yes, you can call your 'get_sub' or 'get_add' function, whatever it may be. 328 00:17:16,000 --> 00:17:19,098 Anyway, those two are taking two values - 'p,q' or 'm,n'. 329 00:17:19,000 --> 00:17:23,000 That's why I'm passing two values, 'get_sub(9,10)'. 330 00:17:23,800 --> 00:17:25,200 Now, let me run it and see the result. 331 00:17:25,200 --> 00:17:28,800 We are getting -1. Let me take 19 and 10, 332 00:17:28,800 --> 00:17:31,109 [no audio] 333 00:17:31,099 --> 00:17:32,800 or let me define some variable called, 334 00:17:32,800 --> 00:17:35,900 let's say some 'x = 50'. 335 00:17:35,900 --> 00:17:38,010 [no audio] 336 00:17:38,000 --> 00:17:41,900 Now you can pass one value as variable and one more as directly 337 00:17:41,900 --> 00:17:43,700 value, no problem. It will work. 338 00:17:45,200 --> 00:17:51,800 Only thing, finally it is going to match the values 19 with 339 00:17:51,800 --> 00:17:54,200 the 'm' and 'x' value with the 'n'. 340 00:17:54,200 --> 00:17:57,400 So, what you are mapping? Only values you are more mapping 341 00:17:57,400 --> 00:17:59,700 here. That's very important thing. 342 00:18:00,100 --> 00:18:03,400 So, guys, this is a simple way to work with your arguments. 343 00:18:04,500 --> 00:18:05,900 Right. Okay guys, 344 00:18:05,900 --> 00:18:07,300 thank you for watching this video. 345 00:18:07,300 --> 00:18:13,507 [no audio]