Is boolean is a data type | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

Is boolean is a data type

boolean return only 0 and 1

12th Feb 2018, 3:10 PM
Shridhar Rai
Shridhar Rai - avatar
8 Answers
+ 17
in java , only true or false //no 0 or 1
12th Feb 2018, 4:48 PM
Gaurav Agrawal
Gaurav Agrawal - avatar
+ 3
in c++
12th Feb 2018, 4:20 PM
Shridhar Rai
Shridhar Rai - avatar
+ 3
yes , Boolean is a data type in python . Boolean have a class which is <class 'bool'> the bool is gives two value "True" either "False" if any thing is "n" then it's return the True . and it return False if only the value is "0" or False True =1 False=0 for example: s="hello world" str_= bool(s) >>>True
19th Feb 2018, 7:07 PM
suneel singh
suneel singh - avatar
+ 1
Depends. In what language?
12th Feb 2018, 3:15 PM
1of3
1of3 - avatar
+ 1
It returns 0 and 1 or True and False or Yes and No.
12th Feb 2018, 3:31 PM
SQL Guy
+ 1
I think you are right Sunnel Singh
5th Jun 2018, 6:04 PM
demian
0
In C, boolean is indeed a data type.
12th Feb 2018, 5:29 PM
1of3
1of3 - avatar
0
在java中,boolean的位长为1,取值范围为true,false, default value is false.
13th Feb 2018, 1:26 PM
王昕
王昕 - avatar