Excessive Lambda Python