+ 1
What is the meaning of boolean
Can I know what is the meaning
4 Réponses
+ 4
Hello 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')
+ 2
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.
+ 2
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.