PyTricks-Differebt ways to test multiple flags at once in

mac2022-06-30  26

x, y, z = 0, 1, 0 if x == 1 or y == 1 or z == 1: print('passed') if 1 in (x, y, z): print('passed') if x or y or z: print('passed') if any((x, y, z)): print('passed')

上面的公式效果是等效的。

转载于:https://www.cnblogs.com/c-x-a/p/11313093.html

相关资源:微信小程序源码-合集4.rar
最新回复(0)