  So far we have looked at functions with empty parentheses that do not take arguments, but we can define parameters in function definitions within their parentheses.

A parameter is a named entity in a function definition, specifying an argument that the function can accept.

Let’s create a small program that takes in parameters x, y, and z. We’ll create a function that adds the parameters together in different configurations. The sums of these will be printed by the function. Then we’ll call the function and pass numbers into the function.

```def add_numbers(x, y, z):
a = x + y
b = x + z
c = y + z
print(a, b, c)

We passed the number 1 in for the x parameter, 2 in for the y parameter, and 3 in for the z parameter. These values correspond with each parameter in the order they are given.

The program is essentially doing the following math based on the values we passed to the parameters:

```a = 1 + 2
b = 1 + 3
c = 2 + 3```

The function also prints a, b, and c, and based on the math above we would expect a to be equal to 3, b to be 4, and c to be 5. Let’s run the program:

`3 4 5`

When we pass 1, 2, and 3 as parameters to the add_numbers() function, we receive the expected output.

Parameters are arguments that are typically defined as variables within function definitions. They can be assigned values when you run the method, passing the arguments into the function. Introduction

In addition to calling parameters in order, you can use keyword arguments in a function call, in which the caller identifies the arguments by the parameter name.

When you use keyword arguments, you can use parameters out of order because the Python interpreter will use the keywords provided to match the values to the parameters.

Let’s create a function that will show us profile information for a user. We’ll pass parameters to it in the form of username (intended as a string), and followers (intended as an integer).

```# Define function with parameters
print("Followers: " + str(followers))```

Within the function definition statement, username and followers are contained in the parentheses of the profile_info() function. The block of the function prints out information about the user as strings, making use of the two parameters.

Now, we can call the function and assign parameters to it:

```def profile_info(username, followers):
print("Followers: " + str(followers))

# Call function with parameters assigned as above
profile_info("sammyshark", 945)

# Call function with keyword arguments

In the first function call, we have filled in the information with a username of sammyshark and followers being 945, in the second function call we used keyword arguments, assigning values to the argument variables.

Let’s run the program:

```Username: sammyshark
Followers: 945
Followers: 342```

The output shows us the usernames and numbers of followers for both users.

This also permits us to modify the order of the parameters, as in this example of the same program with a different call:

```def profile_info(username, followers):
print("Followers: " + str(followers))

# Change order of parameters

When we run the program again , we’ll receive the following output:

```Username: cameron-catfish
Followers: 820```

Because the function definition maintains the same order of print() statements, if we use keyword arguments, it does not matter which order we pass them into the function call. Keyword Arguments

We can also provide default values for one or both of the parameters. Let’s create a default value for the followers parameter with a value of 1:

```def profile_info(username, followers=1):
print("Followers: " + str(followers))```

Now, we can run the function with only the username function assigned, and the number of followers will automatically default to 1. We can also still change the number of followers if we would like.

```def profile_info(username, followers=1):
print("Followers: " + str(followers))

When we run the program, we’ll receive the following output:

```Username: JOctopus
Followers: 1
Followers: 945```

Providing default parameters with values can let us skip defining values for each argument that already has a default. Default Argument Values

Write a program using one function that uses 2 parameters to pass in two numbers. The function should then demonstrate 3 maths processes using them.

Write a program using one function that uses keyword arguments to pass in two strings. The function should then use concatenation to combine them.

Write a program that uses 2 functions. One should pass direct parameters and the other should have keyword arguments. The purpose of the program is up to you!!  If you need to get in touch with Mr McG then this is the way….

Thank you [name], that's great.

Can I ask where you are from?
Hey [name], can I ask where you are from?
Hey [name], which class are you in?
OK [name], thanks for that.

Thanks [name], nearly there.