Top "Boolean" questions

A Boolean data type is a data type with only two possible values: true or false.

Radio Buttons ng-checked with ng-model

In my HTML page, I have two sets of Boolean based radio buttons: Labeled: "Yes" and "No" / Values: True and …

angularjs postgresql radio-button boolean angular-ngmodel
What is the difference between & and && in Java?

I always thought that && operator in Java is used for verifying whether both its boolean operands are true, …

java operators boolean bitwise-operators
bash "if [ false ];" returns true instead of false -- why?

Why does the following output True? #!/bin/sh if [ false ]; then echo "True" else echo "False" fi This will always …

bash boolean conditional-operator
python how to "negate" value : if true return false, if false return true

if myval == 0: nyval=1 if myval == 1: nyval=0 Is there a better way to do a toggle in python, like a nyvalue = …

python boolean negate
How are booleans formatted in Strings in Python?

I see I can't do: "%b %b" % (True, False) in Python. I guessed %b for b(oolean). Is there something …

python boolean string-formatting
Check if at least two out of three booleans are true

An interviewer recently asked me this question: given three boolean variables, a, b, and c, return true if at least …

java boolean boolean-logic
Converting bool to text in C++

Maybe this is a dumb question, but is there any way to convert a boolean value to a string such …

c++ string boolean
Counting the number of True Booleans in a Python List

I have a list of Booleans: [True, True, False, False, False, True] and I am looking for a way to …

python list boolean counting
Cleanest way to toggle a boolean variable in Java?

Is there a better way to negate a boolean in Java than a simple if-else? if (theBoolean) { theBoolean = false; } else { …

java boolean
PHP - Get bool to echo false when false

The following code doesn't print out anything: $bool_val = (bool)false; echo $bool_val; But the following code prints 1: $bool_…

php boolean