Replace lambda with def

Report a typo

Consider the following lambda function:

lambda x: -1 if x < 0 else 1

Can 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.
Write a program in Python 3
def my_function():
return
___

Create a free account to access the full topic