I have code like this
def function3():
print(text)
def function2():
text = "Hello"
function3()
def function1():
text = "World"
function3()
Like you see i want to automatically pass variable from function2 and function1 to function3. This variable should be visible only on this three functions (so I can't set it global). Also I don't want to pass this variable every time between round brackets, because I will use function3 thousands of times. Is there a something like keyword use in php?
function3() use (text):
print(text)
function3()"thousands of times" and havingfunction3(arg)"thousands of times" ?