Hello I have one question.I am reading book and the chapter is about function calling another function.there is given this code:
def now_say_it(content):
print(content)
def say_something():
what_to_say = "Hi"
now_say_it(what_to_say)
say_something()
and there is said that "Note: The function that is called must be earlier in your code than the function that calls it." So it means that in def say_something() we are calling for now_say_it function right? as I understand in his note he says that this now_say_it function(def now_say_it) must be before(above) function say_something(def say_something).Am I right?
But when I write like this :
def say_something():
what_to_say = "Hi"
now_say_it(what_to_say)
def now_say_it(content):
print(content)
say_something()
it still works.But why the author wrote that note? or I assembled code incorrectly? The book I am reading is "A smarter way to learn python" by Mark Myers(chapter 50: Functions within functions)
P.s.Please advise me some good books to learn Python