# Python CodeRecipe|andの使い方

Home Python Keywords

# andの例1

Return True if both statements are True:

    x = (5 > 3 and 5 < 10)print(x)

# andの定義及び使い方

and関数およびは、論理演算子です。 論理演算子は、条件文を結合するために使用します。 両方の場合にのみTrueが返されます。 文はTrueを返し、それ以外の場合は次のようになります。 はFalseを返します。

# andの例2

Using the and keyword in an
  if statement:

    if 5 > 3 and 5 < 10:  print("Both statements are True")else:  print("At 
    least one of the statements are False")

Related Pages The keywords or, and not are also logical operators. Read more about operators in our Python Operators Tutorial.

Home Python Keywords