Lambda Function If Statement Python