Is it possible to return a boolean and a variable from a function in python
def foo(self, x):
if x > 5:
y = 2 #for workaround with pass by reference method
return true , y
# calling it by
i = 0
for i in range (0,10):
if foo(i):
ref_value = y #to get the reference value
y = 2; return True, yis exactly the same asreturn True, 2.