I have been working on a python course on linked learning.The following was said in the course "Python does not support forward declaration but the line if __name__ == '__main__': main()
enables forward declaration".
Then I tried the following code:
main()
def main():
kitten()
def kitten():
print('meow')
And it worked just fine. Now I'm confused about the python flow.
I would like to understand even when kitten()
was defined after it was called how did it still run.
Thanks in advance.