 The book covers functions quite well so there's not a lot I can add to it. You really, really need to read the material and, most important, use the code lens feature to step through the functions one step at a time. This will aid your understanding immensely. Here's a quick recap and some small amount of additional information. You can think of a function as a black box where you drop in some input value or values into the input hopper and receive some output value. The definition of the black box itself is done via the DEF keyword, DEF. The variable names A and B are called parameters. Think of them as placeholders. In terms of our diagram, they are labels for the input hoppers to our black box. And the return statement sends the value that follows it out the output hopper. When you call the function, you provide actual values, called arguments, that fill in the parameter placeholders. And the returned value becomes the result of the function call. A lot of people use the words parameter and argument interchangeably. Don't do that. Here's how you can remember which one is which. The arguments are actual values that fill in the placeholder parameters. Argument and actual both begin with A, placeholder and parameter both begin with the letter P. The book uses code lens to go through the programs one step at a time. THANI has a similar feature used for debugging programs. To use this feature most effectively, go to the view menu and choose variables. And a window will open up to show you your variables as you go through your program. Then choose debug current script from the run menu. This brings up a toolbar with three icons. Step over, step into, and step out. To see absolutely everything that Python is doing, we're going to use step into in this video. Highlighted in yellow is what Python is currently looking at. It's starting with line 5, the definition of the function. It says, oh, I've got a function here, and when I step into it, it says, great. Here's a function called average, and that weird number following the word at happens to be the memory address where the function resides, and we may safely ignore that. Python then moves to line 9, and it has to evaluate this statement. The first thing it has to evaluate is the right-hand side. It starts out by figuring what the arguments to average work out to. So as I step in, it shows that 3 works out to 3, and 6 is 6. Now it's ready to call the function. When the function call is made, THANI opens up a new window to show that function and its variables. So here's the function, and down here are what are called the local variables. And you'll notice that it's already filled in the parameters A and B with the arguments 3 and 6. Python needs to evaluate this assignment statement, so as we step in, we find that we use the right-hand side first, and now it needs to add A and B. It evaluates A, which is currently 3, and B, which is currently 6, so that works out to 9. 2 works out to 2, and now we can do the division 9 divided by 2, which is 4.5, and that is what variable result will refer to, and as you can see, that has now been added to our variable list. Now we're at the return statement, and THANI has to, or rather, Python, has to evaluate result. Result is 4.5, and that's what gets returned to the caller. So the whole right-hand side of line 9 has worked out to the value 4.5, and that becomes the value that our new variable AVG refers to. The last statement in the program prints the average, and rather than go through that step by step, we'll do a step over, which will do that statement all at once, which prints out 4.5, and the program finishes. That's how you use the debugger in THANI to go through a program one statement at a time to see exactly what Python is really doing.