【发布时间】:2013-11-20 09:01:40
【问题描述】:
Python 是否有独占 AND 运算符(例如 C# 中的 &&)?
我没有设法在 Python 文档中找到它(也没有解释为什么不支持它)。
谢谢!
【问题讨论】:
-
什么是“异与”?你的意思是“exclusive NOR”,即“(A and B) OR not (A and B)”?
Python 是否有独占 AND 运算符(例如 C# 中的 &&)?
我没有设法在 Python 文档中找到它(也没有解释为什么不支持它)。
谢谢!
【问题讨论】:
C# 的 && 运算符的 Python 等效项拼写为 and。
查看文档:http://docs.python.org/2/library/stdtypes.html#boolean-operations-and-or-not
【讨论】: