Logic Operations In Python