Logical Operator using Python 3