There's no hoisting of the type you're looking for.
Python does some hoisting, for example variables that are declared in a block (like the for loop variable) are hoisted to the scope the block is in.
But you cannot reference a variable (or other name, like a function) before it has been assigned or defined.
If you want to have that order of code, this a way around it, but it hardly helps readability:
def f(a, b):
def _f():
return divide(a, b)*a
def divide(a, b):
return a / b
return _f()
print(f(10, 5))
}
More in general, don't try to force the conventions of one language on another - use the language that has the conventions you like, or learn the conventions of the language you use. Other coders reading your code (including future you) will thank you.