29. Lambdas

If you have one-liner functions, avoid using function declaration with def. Instead, use lambda.

29.1. Don’t do this

1def add_one(x):
2    return x + 1
3
4add_one(3)

29.2. Do this

1add_one = lambda x: x + 1
2
3add_one(3)