Consider the following lambda function:
lambda x: -1 if x < 0 else 1Can you see what it does? Define an equivalent 'normal' (non-anonymous) function.
Please don't change the name of the function as it facilitates testing of the task.
Consider the following lambda function:
lambda x: -1 if x < 0 else 1Can you see what it does? Define an equivalent 'normal' (non-anonymous) function.
Create a free account to access the full topic