def gameover(a,b):
return a == 15 or b == 15
print(gameover(0,0))
对上面的代码不是很理解
def gameover(a,b):
return a == 15 or b == 15
print(gameover(0,0))
对上面的代码不是很理解
a == 15 or b == 15是个表达式,返回true或false
所以gameover的返回值不是true就是false
当其中一个参数是15就返回true,两个都不是15就返回false