Skip to content

Commit 2fc660a

Browse files
committed
explain arguments more
1 parent 8fdcc8a commit 2fc660a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

defining-functions.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,10 @@ and prints it. Maybe a custom function could also take an argument?
199199
>>>
200200
```
201201

202+
Here `message` is an argument. When we call the function we'll get a
203+
local variable called message that will point to whatever we passed
204+
to `print_twice`.
205+
202206
This function can be called in two ways:
203207

204208
- Using a **positional argument**.
@@ -213,6 +217,9 @@ This function can be called in two ways:
213217
>>>
214218
```
215219

220+
When the function was running it had a local `message` variable
221+
that pointed to `"hi"`. The function printed it twice.
222+
216223
Positional arguments are great for simple things, but if your
217224
function takes many positional arguments it may be hard to tell
218225
which argument is which.

0 commit comments

Comments
 (0)