My question is this: is it possible to use full conditional statements (if, elif, else) in a return?
I am aware that I can do this:
def foo():
return 10 if condition else 9
Am I able to do something like this:
def foo():
return 10 if condition 8 elif condition else 9
Afterthought: Looking at this form it does not appear to be very readable and my guess is it probably does not have any valid use cases. Regardless, curiosity prompts me to ask. Thank you in advance for any answers.