关于Python的 and 运算符问题
True and 'whatever‘ 返回右边的值 False and 'whatever' 返回左边的值 True or 'whatever' 返回左边的值 False or 'whatever' 返回右边的值
记得0、None都被视为False,其他视为True
- 1
True and 'whatever‘ 返回右边的值 False and 'whatever' 返回左边的值 True or 'whatever' 返回左边的值 False or 'whatever' 返回右边的值
记得0、None都被视为False,其他视为True
起名比做卷子难
请问Python的and运算符的运算顺序是先计算第一个参数,若为false则返回第一个参数;若为true则返回第二个参数吗?
有代码如下:
请指教,谢谢