The return values of functions?

How should be the function described below this code:
tmp = 0
function(tmp)
print(tmp)

Just returned the value 3 to the variable tmp without using the exit and error (the return values for the parameters passed)
June 5th 19 at 21:19
1 answer
June 5th 19 at 21:21
Solution
without global? - althea_Park commented on June 5th 19 at 21:24
no. - gunnar.Barrows commented on June 5th 19 at 21:27
,

well, you can certainly so to make fun of Python
but for this poidee hands need to break

import inspect 

def function(var):
 lcls = inspect.stack()[1][0].f_locals
 for name in lcls:
 if id(var) == id(lcls[name]):
 globals()[name] = 3
 break
- Uriah_Kreiger commented on June 5th 19 at 21:30
okay. thank you - althea_Park commented on June 5th 19 at 21:33

Find more questions by tags Python