【发布时间】:2021-04-13 21:26:45
【问题描述】:
这里的elif someother_function():检查是否为真,还需要打印返回值。
谁能帮我解决这个问题?
def some_function():
if correct:
return True
else:
return False
def someother_function():
if correct:
return True,f
else:
return False,None
if some_function():
print("something")
elif someother_function():
print(f)
else:
print("nothing")
这里,如何将 f 从 someother_function 返回到它在 elif 调用的地方?
【问题讨论】:
标签: python-3.x function if-statement