Top "Boolean-expression" questions

A boolean expression is an expression in a programming language that produces a boolean value when evaluated, i.e. one of true or false.

Why does `a == b or c or d` always evaluate to True?

I am writing a security system that denies access to unauthorized users. import sys print("Hello. Please enter your name:") …

python boolean boolean-expression
Merge lists that share common elements

My input is a list of lists. Some of them share common elements, eg. L = [['a','b','c'],['b','d',…

python list merge boolean-expression connected-components
boolean variable values in PHP to javascript implementation

I've run into an odd issue in a PHP script that I'm writing-- I'm sure there's an easy answer but …

php javascript boolean-expression
Boolean expression order of evaluation in Java?

Suppose I have the following expression String myString = getStringFromSomeExternalSource(); if (myString != null && myString.trim().length() != 0) { ... } Eclipse warns me …

java compiler-warnings boolean-logic boolean-expression
Detecting XOR in Karnaugh Maps

I got the following Karnaugh Maps but I am still having problems working out the expression for XOR from each …

xor boolean-expression karnaugh-map
Python boolean expression and or

In python if you write something like foo==bar and spam or eggs python appears to return spam if the …

python syntax boolean-expression
Convert function with only AND Boolean operations

I have some function like (A and ( B or c)) or (D and E and (F or H or R …

boolean logic boolean-logic boolean-expression boolean-operations
Is there any reason for "Boolean.TRUE.equals(x)" in Java?

I've come across this code in one of the projects I'm working on (This is in Java) if (Boolean.TRUE.…

java boolean-expression
what is the correct way to check for False?

Which is better? (and why?) if somevalue == False: or if somevalue is False: Does your answer change if somevalue is …

python boolean boolean-expression
XOR of three values

What is the simplest way to do a three-way exclusive OR? In other words, I have three values, and I …

language-agnostic logic boolean xor boolean-expression