Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

python and operator

 python And operator:

  • The python And operator is one of the logical operators.
  • In And operator, if both the operands are true then it returns true, otherwise false.
  • And operator is applicable for boolean type and non-boolean type.
  • For example: 1 And  " a"  then the result is "a".  
  •  It is represented by the  "&" symbol.
  •  It is written as  x &y
syntax:(a&b).

# write a python program using And operator.

  1. x=23
  2. y=44
  3. print(x>10 and y>10)
  4. print(x
  5. print(x&y)
  output:   true
                false
                 4


This post first appeared on Java Tutorial - InstanceOfJava, please read the originial post: here

Share the post

python and operator

×

Subscribe to Java Tutorial - Instanceofjava

Get updates delivered right to your inbox!

Thank you for your subscription

×