Can someone explain the logic or syntax of
function()()
or
function(function)()
An example: I can't seem to grasp the idea of how this actually works
func2(func1)("bye")
def func2(fn):
print("func2")
def func3(text2):
print("func3")
print(text2)
return func3
def func1():
print("func1")
func2(func1)("bye")
Output:
func2
func3
bye