Python | Boolean

python boolean,python boolean data type
python boolean

                            

Python | Boolean

Booleans are represent two value True and False

When you compare two values, Python returns the Boolean answer True or False

Example

    print(10 > 9)        #Return True
    print(10 == 9)       #Return False
    print(10 < 9)        #Return False

      

        Booleans with Conditional statement 

Example    

            a = 200        

            b = 33


    if b > a:
      print("b is greater than a")    
    else:
      print("b is not greater than a")     


Explanation

suppose , the if condition is false so else part is print ' b is not greater than a '


Booleans With Functions 

Example

    def Fun() :
      return True

    print(Fun())

        

       Explanation

        When print function is Execute then the Fun() is call and Return True




        Also See

    

Post a Comment (0)
Previous Post Next Post