Lambda Function If Statement Python Code