1 00:00:00,560 --> 00:00:08,990 Let's talk about arguments versus parameters, which is one of our key terms that we use when describing 2 00:00:08,990 --> 00:00:09,530 functions. 3 00:00:10,460 --> 00:00:11,360 Let's see what they mean. 4 00:00:12,460 --> 00:00:19,720 You see right now, our say hello function is pretty generic, very simple, right, we're just bioprinting. 5 00:00:19,720 --> 00:00:20,230 Hello. 6 00:00:21,110 --> 00:00:29,540 It's kind of useful, but not really the power of functions beyond just being able to call this multiple 7 00:00:29,540 --> 00:00:37,340 times because it only lives in one location and memory is this ability for us to make it dynamic. 8 00:00:38,000 --> 00:00:39,800 For example, in these brackets. 9 00:00:40,280 --> 00:00:42,890 I can give it what we call parameters. 10 00:00:43,490 --> 00:00:47,420 So in here we give it parameters. 11 00:00:50,230 --> 00:00:54,160 Inside of the Brackin, so, for example, I can give it a name. 12 00:00:55,500 --> 00:01:00,540 Which is a variable that I just made up, I can call whatever I want and I can leave it like that, 13 00:01:00,720 --> 00:01:03,810 or I can keep giving it parameters as many as I want. 14 00:01:03,810 --> 00:01:05,900 I can keep adding a hundred if I want it to. 15 00:01:07,270 --> 00:01:15,280 So in this case, let's just say this is an emoji, so these are two variables or parameters that I've 16 00:01:15,280 --> 00:01:20,500 created and this say hello function is able to receive. 17 00:01:21,620 --> 00:01:23,870 These two parameters, what does that mean? 18 00:01:24,200 --> 00:01:28,350 It means that we're able to use these variables inside of this function. 19 00:01:28,970 --> 00:01:34,970 For example, I can create this as an F string and say hello. 20 00:01:38,150 --> 00:01:38,750 The name. 21 00:01:39,980 --> 00:01:47,990 And then finally add the emoji, and because I have these parameters, I can use them as variables inside 22 00:01:47,990 --> 00:01:49,120 of this code block. 23 00:01:49,940 --> 00:02:00,020 Now, these parameters allow us to give the function when we call it what we call arguments. 24 00:02:00,380 --> 00:02:05,750 And by the way, the confusion between parameters and arguments, people usually say one when they mean 25 00:02:05,750 --> 00:02:06,230 the other. 26 00:02:06,740 --> 00:02:08,450 It's a little tricky. 27 00:02:08,460 --> 00:02:09,300 So hang in there. 28 00:02:09,890 --> 00:02:16,520 Arguments are used as the actual values we provide to a function. 29 00:02:17,710 --> 00:02:25,450 So now in Say Hello, I can give it a name in my case, let's just say hi to myself and then I can give 30 00:02:25,450 --> 00:02:34,000 it an emoji and you see how my editor is giving me the hint that I should give it an emoji, because 31 00:02:34,000 --> 00:02:37,510 while I defined it here again, something that editors help us do. 32 00:02:38,050 --> 00:02:40,870 So let's just give it just a smiley face with the tangoed. 33 00:02:41,380 --> 00:02:43,570 Now, these are arguments. 34 00:02:43,810 --> 00:02:51,400 These are the actual value we provide to the function and the name of the variables that we use that 35 00:02:51,400 --> 00:02:53,320 we receive are called parameters. 36 00:02:53,950 --> 00:03:01,240 So parameters are used when we define the function and arguments are used when we call the function. 37 00:03:02,280 --> 00:03:11,580 Define and call, and by the way, some people also like saying call or invoking the function or invoke 38 00:03:11,580 --> 00:03:12,130 the function. 39 00:03:12,510 --> 00:03:15,360 So if you ever hear those words, you know what they mean. 40 00:03:16,740 --> 00:03:17,910 So if I run this. 41 00:03:19,380 --> 00:03:22,800 I get hello, Andre, with that smiley face. 42 00:03:24,100 --> 00:03:31,600 And this is when functions get really powerful because we're able to not just make generic functions 43 00:03:31,600 --> 00:03:38,290 that always do the same thing, but we can create functions that do things based on what parameters 44 00:03:38,320 --> 00:03:42,550 we give it or what arguments we call it with. 45 00:03:43,690 --> 00:03:53,700 So that now I can use the say hello function to say hello to my friend Dan and also my friend Emily, 46 00:03:54,190 --> 00:03:58,840 and if I click run, we've made our function more extensible. 47 00:04:00,020 --> 00:04:07,190 We can use it in multiple places, and if we're designing a game, well, we've just used this to greet 48 00:04:07,190 --> 00:04:12,680 our users and based on the username, I can use the same function over and over. 49 00:04:13,660 --> 00:04:20,290 Again, we're keeping our code dry and clean by doing something like this, how cool is that? 50 00:04:21,790 --> 00:04:24,610 All right, let's take a break and I'll see you in the next video.