Boolean Logic in Python programming language