Logical Function In Python With Parameters