Skip to content

Commit

Permalink
Merge pull request #26 from elliewix/patch-3
Browse files Browse the repository at this point in the history
adding recipe card analogy about function defs
  • Loading branch information
c-martinez authored Jun 7, 2017
2 parents f80ee75 + 7cbb8a5 commit 5f206bc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions _episodes/14-writing-functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ def print_greeting():
* Defining a function does not run it.
* Like assigning a value to a variable.
* Must call the function to execute the code it contains.
* The commands for the function are read and stored after the `def` block, but not actually executed until the function is called later on.
* Imagine getting a recipe card and keeping it in your kitchen. You can cook it anytime, but you haven't completed any of the steps until you start that cooking process.
* This means that Python won't complain about problems until you call the function. More specifically, just because the definition of a function runs without error doesn't mean that there won't be errors when it executes later.

~~~
print_greeting()
Expand Down

0 comments on commit 5f206bc

Please sign in to comment.