我不相信我把它设置正确......因为不管我为foo()填写什么数字,它似乎总是返回“True”。我究竟做错了什么??Python Return True或False
# Complete the following function.
# Returns True if x * y/z is odd, False otherwise.
def foo(x, y, z):
answer = True
product = (x * y)/z
if (product%2) == 0:
answer = False
return answer
print(foo(1,2,3))
让我问你,你会输入什么来返回假 – 2014-12-06 08:55:07
是的,它在我的实际程序中是正确的,但我没有在这里设置正确的发布。 – 2014-12-06 08:55:45
[嗯,它工作正常](http://labs.codecademy.com/CdIh#:workspace) – 2014-12-06 08:57:30