A function is a lot like a vending machine. On a vending machine, you enter a code and out comes something to eat or drink. There's an input (the code you type in) and an output (the food or drink the machine drops at the bottom for you).
A function takes an input value and gives you an output value. For example, if you entered the code D4, the vending machine might drop a bag of pretzels. The input is D4 and the output is the pretzels.
Or let's say you type in the code C2 and it gives you a bag of chips. In this case, the input is C2 and the output is the chips.
There are different ways you can describe a function. Some definitions are more technical than others. A basic definition of a function is below. As you learn more vocabulary words associated with functions, you will probably see more advanced definitions. For now, here's what is important to know about a function: