Python And

Python and is used to combine conditional statements, for example:

>>> x = 3
>>> x > 2 and x < 5
True
>>> x > 3 and x < 5
False

and will return True if both statements are true, or False otherwise. It’s most frequently used in an if/else statement

if x > 3 and x < 8:
   print('x is greater than 3 and less than 8')
else
   print('x is not greater than 3 and less than 8')