Sql If Operator Python Definition Range