 So before we just pass two arguments we called it x and y we've called it a and b but we can also pass these default values So yeah, I've got a new function called funk if you in see And it's a b and I put c equals 100 and What is my function going to do? It's going to print a line of text, which is we have Let's have that we have the values a b and c and And those are placeholder text so we're going to pass that so let's call it But we only call we only add two arguments One and ten so the ones going to go in the a the tens going to go in the b But what's going to happen to the c because it's going to print c to the screen and then as you might expect It's going to take that default value that I added there That's not to say that we can't change that default value here I'm going to use the same function going to call it but I add one two and I add the third one called three Which is certainly different from this default value. That's a hundred. So let's see what happens when we execute that line of code Certainly, we have the values one two and three So that is very very useful So you're someone who uses these functions can omit that see as we did they and the default value will be used Now what about keyword arguments to pass? This order problem because think about it now I've only got three there, but what if I had multiple ones and I want to use that function But it's been a while since I've used that function I can't remember this exact order that it was because it is going to take that order now That is where we get this very useful very useful Very useful format of keywords now look at this function function fun to As I say the apologies, I have this very ridiculously long print statement here, but it'll make sense in a little bit I don't know why I put it all in one line even if done that anyway fun to ABC equals a hundred So I definitely I have this ordered list a B and C Then I have the semicolon and after the semicolon I have more of of these Default assigned arguments, but they are a bit different. I say P equals a hundred and Q equals red I'm going to print this ridiculously long print statement, and I'm not going to go through it You'll see what it actually prints and then it's going to return a times B Now let's just see what happens to these things now I'm going to call the function first of all just with two values because remember all of these C and P and Q they have default values. So that doesn't really matter I only need to pass these two since those are already assigned so I only have to do that I can't call it with one though because it'll tell me there's a problem You know what is the second value, but certainly I do that now Let's just see what the ridiculously long print statement had in it It had the first ordered argument value is 3 because 3 came first the second ordered argument is 4 The third ordered argument was optional remember it stays C is a hundred if you see a value of a hundred here You either pass the value of a hundred so I could have said 3 comma 4 comma 100 or you omitted it And indeed I get back a hundred because I didn't put it in here So I just used the default that was there. Let's see what happened to the keyword P It took my value 100 and to the keyword Q. Well, I took the value red which was there. So nothing Spectacularly happened and oh, yes, let's also return something useful like multiplying 3 and 4 yielding 12 So that's my that's all of my print statements with the placeholders in it But you can see what happens if we don't now Let's start playing now. We've seen this before I can add something for C my ordered list A, B and C So now instead of the hundred damn gonna see 5 everything else stays the same Now let's change P and instead of P being that 100 that it was I'm gonna say P equals Pi Now what happens 3 is still 3 second one's still 4 The fourth one we didn't add which at the third one We didn't edge which was C which had a default value of 100 so the hundred still there The P now changed to Pi 3.141, etc The Q still stays red and we still multiplying three times one still 12 Now let's go for the Q and Q's place. I'm not gonna put hello and you can see that Exactly what you would think would happen and then instead of the C. There's a two Okay, but these are keyword arguments and that is what this whole section was about we can swap them around So P and Q needn't be an order so I'm passing 3 this is part of the ordered stuff So it's gonna be a B and C, but now I've swapping P and Q around. Let's see what happens now Still it works because P is now Oilers number 2.718, etc And Q is now it works as we passed it there, but the order doesn't matter So that's very beautiful for keywords and those keywords came after They came after the semicolon so anything after the semicolon is Does not require any kind of order to it You can pass it in any kind of order and if you don't use it or they do have these defaults So that's beautiful. So in this last but let's go really let's go bananas as I said Yeah, so we're gonna say Q equals 2 so that came first Then we have 3 and 4 and then we have a P and then we have 2 So my order is now completely jumbled up, but Julia can handle that this function can handle that It's so Q now. That's the thing. I have to because it's a keyword. I have to use Q equals bananas I could not just have said bananas because it would then accept that as the first The value for the first argument a So I've got to use the keywords actual name Q equals bananas It'll then say 3 and 4 as part of my audit sequence there So A would be 3 B would be 4 then it sees the P equals square root of 3 So again, I have to use the keywords actual name and then this 2 is going to become C So let's run that and you see exactly Second time I've run it. That's exactly what we're gonna see printed to the screen So if you have this long list of arguments use those keywords, remember that the keywords You sign them with defaults, but then and if you call them They have to have the name of that keyword past as well And you can give them useful names so that you or someone who uses your code can remember what stands for Now the next section we're going to look with Functions with a very variable number of keywords So not just me listing how many they are but allowing any number up to an infinite number of arguments to be used That's up next You