Skip to content

Commit 9eb953c

Browse files
authored
Merge pull request DjangoGirls#1635 from lindboe/clarify-function-definition-vs-execution
Clarify calling functions explanation
2 parents c212a42 + d019c9b commit 9eb953c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

en/python_introduction/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -815,7 +815,7 @@ hi()
815815

816816
Okay, our first function is ready!
817817

818-
You may wonder why we've written the name of the function at the bottom of the file. This is because Python reads the file and executes it from top to bottom. So in order to use our function, we have to re-write it at the bottom.
818+
You may wonder why we've written the name of the function at the bottom of the file. When we write `def hi():` and the indented lines following, this is us writing instructions for what the `hi()` function should do. Python will read and remember these instructions, but won't run the function yet. To tell Python we want to run the function, we have to call the function with `hi()`. Python reads the file and executes it from top to bottom, so we have to define the function in the file before we call it.
819819

820820
Let's run this now and see what happens:
821821

0 commit comments

Comments
 (0)