Created
February 26, 2019 20:46
-
-
Save BurhanH/9a2ecf3994b955be8d4094b10f79a66d to your computer and use it in GitHub Desktop.
lambdas
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
addition = lambda x, y: x + y | |
addition(3, 3) | |
#6 | |
# OR | |
(lambda x, y: x + y)(3, 3) | |
#6 | |
sorted(range(-5, 6), key=lambda x: x * x) | |
#[0, -1, 1, -2, 2, -3, 3, -4, 4, -5, 5] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment