我有两个函数,我想从另一个函数中调用一个函数。
print(first_contains_second("apple", "ppl"))
print(one_contains_another("ppl", "apple"))
示例为
FAILURE: Build failed with an exception.
答案 0 :(得分:2)
您可以执行以下操作:
def one_contains_another(word1, word2):
if first_contains_second(word1, word2) or first_contains_second(word2, word1):
return True
return False
答案 1 :(得分:0)
您可以使用装饰器,看看这个link。