Functions are reusable chunks of code. Once code is wrapped in a function, you can use it in other places. First, you’ll learn how to use functions. Later, you’ll learn how to make them yourself.
When you want to “use” a function, we say that you “call” it. Another term is “invoking” a function. You can also use the terms “execute” and “run”, although those are usually reserved for full programs.
# Function name followed by parentheses round(3.75)
There are two essential parts to calling a function: the name of the function, and then parentheses following the name.

To call a function, you must add parentheses. Otherwise, you are simply referring to the name of the function rather than executing it. Think of it as the difference between “thinking about going to the store” and “actually physically going to the store”. The parentheses are what actually make this a function call, not just the function name being mentioned for no reason.

A program and a function are similar, but not quite the same. Both follow the same input-process-output pattern. However, functions are typically much smaller, and are meant to accomplish a single specific task.
message = "MAKE THIS LOWERCASE" # Call the `lower` method message = message.lower() print(message)
Methods are a special kind of function. They are attached strongly to a value. The way you write a method call is slightly different too, since it needs to incorporate that value. To call a method, you need the name, parentheses, and two more pieces: the calling value or variable, and a period. You’ll learn more about this syntax in later lessons — for now, get comfortable with the difference between calling functions and methods.

You don’t have to know how a function accomplishes its goal in order to use it. Think of it like a well-run office: when you ask a co-worker to complete some work, you don’t care how it happens, just the inputs and outputs of their process. This separation of concerns lets you focus on one piece of a program without worrying about the whole thing.
# 1 argument
round(4.3)
# 3 arguments
print("First", "Second", "Third")
# Zero arguments - prints a blank line
print()
One of the most useful features of functions is arguments. Arguments are values given to a function that affect its behavior. Arguments are placed inside the parentheses, each one separated by a comma. We say that these arguments are being “passed” to the function.
Function calls do not always require arguments.
The last example above shows how the print function doesn’t need to take any arguments; the function will still print, but only an empty line.
The number of arguments depends on the function and what you want to do with it. Some functions always take one argument, some take multiple arguments sometimes, and everything in between.
# call function, result is returned and assigned new_value = round(3.9) # Can print it, update it, etc. print(new_value) new_value += 1 print(new_value)
Functions are useful because they can return values. A function can return any type of value: string, boolean, integer, whatever. Mentally, when a function is called, you can imagine the result replacing the entire function call — similar to what happens when you do addition or subtraction.

Think of a function as a magic black box. You cannot see inside the box to know how it works, but you don’t need to. Arguments are the knobs and dials on the outside of the box that let you control its workings. The returned value is like a slot that dispenses the function’s result.