Functions act as placeholders for the data they output. Basically, you can assign the output of a function to a variable, just like any normal data.The core concept of this lesson is to learn how to call a function and assign the return value to a variable. Create the variable using and assign the current year as the value. FreeCodeCamp offers a curriculum and in this video we cover their lesson called Assignment with a Returned Value. When I call a function, such as PixelGetColor, it looks like the only way to get the result is to pass a variable to the function. To assign value, use := with parentheses "()" rapped around the statement. If (x := myIndex(y)): return x. We can take the return value of a function and assign it to a variable. Assume we have pre-defined a function sum which adds two numbers together.