The purpose of including a `return`

statement in a function is generally to enable the function to make a result available for a program to use. For example, the `len`

built in function `return`

s a result that indicates the number of characters in a `str`

ing or the number of items in a sequence such as a `list`

.

A programmer who creates a function might choose to include a `return`

statement in the function rather than only a `print`

statement so that a programmer who uses the function could save the result of calling it in a variable.

Below is an example of a function that computes and `return`

s compound interest. After the function definition are two function calls with assignments of the results to variables.

```
def principal_with_interest(p, r, n, t):
# p: the initial principal
# r: annual interest rate percent
# n: number of times annually that interest is compounded
# t: number of years that the money is invested
return p * (1.0 + float(r * 0.01) / n) ** (n * t)
money_in_five_years = principal_with_interest(10000.00, 4.0, 12, 5.0)
money_in_ten_years = principal_with_interest(10000.00, 4.0, 12, 10.0)
print("Five years: ${:0.2f}".format(money_in_five_years))
print("Ten years: ${:0.2f}".format(money_in_ten_years))
```

Output ...

```
Five years: $12209.97
Ten years: $14908.33
```