Python の if 文の条件にブール演算子 and を使う

published:

Python の if 文の条件にブール演算子 and を使う。

次の if 文の例は、式にブール演算子 and を使っている。
変数 hoge が True かつ、変数 huga が True の場合に、print() が実行される。

hoge = True
huga = True

if hoge and huga:
    print('どちらも True である')

Previous Article

Next Article