4 Answers
New AnswerHello Ankita Boolean is nothing but a data type whose value can be true or false, we use boolean in conditions, function which checks or variable which tells yes or know, For example, isPrime = True isAnimal = False isPass = False def isDivisibleByTwo(num): return num%2==0 if True: print('It's true') else: print('False')
A boolean is a value, i.e a binary variable that can have one of two possible values, 0 or 1. Zero denotes false and One denotes true.
Ankita Kumari You have already been given some excellent answers, but I would like to try to explain in a non coding way. We all turn things on & off. Lights, TV, computer, etc..... If your light is on, it exists, therefore it is true. 1 light on is true If your light is off, it does not exist, therefore it is false. 0 lights are on.
Sololearn Inc.
535 Mission Street, Suite 1591Send us a message