I need to return "True" or "False" strings for a boolean value (mostly for display purposes).
It's obviously trivial to write the function:
def bStr (bVar):
if bVar:
return 'True'
else:
return 'False'
In Perl I can do this with the ternary 'if'
(bVar) ? 'True' : 'False'
Is there a simpler way in Python??
If it makes a difference, I'm using 2.2.2 (on Solaris) with no chance of going to 2.3 in the near future <g>; I know
that some of this has changed in 2.3.
TIA . . .
Dan