Python If AND


And

The and keyword is a logical operator, and is used to combine conditional statements:

Example

Test if a is greater than b, AND if c is greater than a:

a = 200
b = 33
c = 500
if a > b and c > a:
  print("Both conditions are True")
Try it Yourself »


Copyright 1999-2023 by Refsnes Data. All Rights Reserved.