Home:ALL Converter>Can I resolve an if statement with the return value of a function then refer to that value without calling it again?

Can I resolve an if statement with the return value of a function then refer to that value without calling it again?

Ask Time:2018-06-08T22:11:46         Author:crazyfox

Json Formatter

I am using the return value of a function to control an if statement:

if my_func(arg):  
  do something
  return my_func(arg)  

Is there a way to refer to the return value in the if block?
EDIT: Found this relevant question:
python flexible, inline variable assignment
Looks like in-line variable assignment is not possible in Python.

Author:crazyfox,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/50762561/can-i-resolve-an-if-statement-with-the-return-value-of-a-function-then-refer-to
yy