3 ms·
The Python equivalent of your JavaScript example is simply: def double(x): return x * 2 Python's `lambda` construct creates anonymous functions - its limi
by bakery2k 8y ago
The Python equivalent of your JavaScript example is simply:
def double(x): return x * 2
Python's `lambda` construct creates anonymous functions - its limitations mean it should only be used when anonymity is required. If a function is to be given a name, there is no reason to use a lambda over standard function syntax.