Skip to content

Commit eda827b

Browse files
committed
Clarify calling functions
The original explanation says that we re-write the name of the example function at the bottom of the file "because Python reads the file from top to bottom, so we need to re-write the name of the function." I find that explanation a bit confusing myself. I think two things were conflated here: 1) The difference between defining and running a function 2) Explaining that Python reads files from top to bottom, and needs functions to be defined before they can be called I tried to more explicitly explain that what we're doing is calling a function we just defined, and break these concepts apart more.
1 parent c212a42 commit eda827b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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 functions in the file before we call them.
819819

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

0 commit comments

Comments
 (0)