>>> def foo(a):
print "called the function"
if(a==1):
return 1
else:
return None
>>> a=1
>>> if(foo(a) != None and foo(a) ==1):
print "asdf"
called the function
called the function
asdf
你好。我怎样才能避免在不使用额外变量的情况下调用该函数两次。