# Creating functions

## Introduction to Functions

**The help function:**

```python
help(print) # You can pass any other function to the help function and this will provide you with info about that particular function
# You just add the name of the function
```

* This shows arguments
* Provides info of what the function does

**The print function:**

```python
# A function does something
print(args) # You pass to a function arguments
```

## Creating your own function:

You define functions with the word `def`

```python
# Defining the function:
def greet_person():
	print("Hello there, this is a greeting...")
	
# Calling the function:
greet_person()
```

## Calling function instances with args:

```python
def greet_person(jiberish): # For this to run it awaits the jiberish arg
	print("Hello there, this is a greeting...")
	
# Calling the function with an arg
greet_person("Taz") # It will not complain as we are adding a arg
```

**To do a more personalized greeting:**

```python
def greet_person(name): 
	print("Hello there " + name + "!")

greet_person("Chris")
# Will print: Hello there Chris!
```

**Adding a default argument to the function:**

* This is used when an arg is not passed to the function

```python
def greet_person(name = "your name"): 
	print("Hello there " + name + "!")
	
greet_person()
# Will print: Hello there your name!
```

**Adding and documenting functions in a prod environment:**

```python
def greet_person(name = "your name"):
	"""
	DOCSTRING: this returns a greeting
	INPUT: name
	OUTPUT: hello ... name
	"""
	print("Hello there " + name + "!")
```

* When you are defining a function the value is a `Parameter`
* When you are calling a function the value is a `Argument`
