How To Define Boolean Function In Python