Python3-logical-operators-example

提供:Dev Guides
2020年6月22日 (月) 21:36時点におけるMaintenance script (トーク | 投稿記録)による版 (Imported from text file)
(差分) ← 古い版 | 最新版 (差分) | 新しい版 → (差分)
移動先:案内検索

Python 3-論理演算子の例

Python言語でサポートされている論理演算子は次のとおりです。 変数 a がTrueを保持し、変数 b がFalseを保持すると仮定する

Operator Description Example
and Logical AND If both the operands are true then condition becomes true. (a and b) is False.
or Logical OR If any of the two operands are non-zero then condition becomes true. (a or b) is True.
not Logical NOT Used to reverse the logical state of its operand. Not(a and b) is True.