>>> def accept(d1, d2):
if somefunc(d1,d2) > 32:
h = 1
else:
h = 0
return h
Does Python have a ternary conditional operator? doesn't give a solution for a case one want to return a value. A lambda based solution is preferable.