how do i get the value of a function i'm using to trigger an if condition in python?
something like...
def is_a_banana(a):
if a == "Banana":
return True
else:
return False
v = "Banana"
if ban = is_a_banana(v):
print ban
>> True
i know i could just split it into...
ban = is_a_banana(v)
if ban:
print ban
but i'm trying to rewrite the following in an efficient way so that i can get the returned values of the functions out. in php i could just bind the output to a variable, is their any way to do this with python?
if s.real_quick_ratio() >= cutoff and \
s.quick_ratio() >= cutoff and \
s.ratio() >= cutoff:
result.append((s.ratio(), x))