Lambda Function With If Condition In Python