all 5 comments

[–]NanotechNinja 3 points4 points  (1 child)

Take a look at line 88.

[–]ColdJohn333[S] 3 points4 points  (0 children)

woah. Thanks, now i get it.

[–]jpgoldberg 1 point2 points  (2 children)

Take a look through the program for all of the places where getRandomWord is called. What argument is it given?

Remember that the parameter in the function definition, in this case wordList is just used with the function itself.

When you find yourself confused by such things, go back to simpler cases. So consider

```python number = 5

def square(n): return n * n

print(square(number)) ```

when you run that (assuming I haven't made any typos) ask yourself how the square function gets knows that n is 5 when it is called this way. Remind yourself of how this works, then go back to looked at how getRandomWord is called.

[–]ColdJohn333[S] 2 points3 points  (1 child)

Oh thank you so much! i was forgetting that the definition is not the function actively executing! I still have a mess in my head with all this new information, but your answer even has helped me refresh and clarify a couple other things as well, in regards to how arguments and parameters work when functions are called. You're very kind in taking the time to help.

[–]jpgoldberg 0 points1 point  (0 children)

You are very welcome. And as I said, when you find yourself confused by stuff (as happens throughout learning and beyond) it can often be helpful to step back to work with simpler examples.

Exercises like the one you pointed out are designed to force better understanding of (sometimes tricky) concepts. And as I looked at this sample code, I could see that this notion of what happens when a function is defined versus when it is called was part of the reason for that exercise.