Created
December 26, 2022 12:09
-
-
Save hamaguchi-amago/fe43127e5ea8013725470e572a9d05fc to your computer and use it in GitHub Desktop.
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
def add(a, b): | |
return a + b | |
# see: https://peps.python.org/pep-0008/#programming-recommendations | |
add_lambda = lambda a, b: a + b | |
if __name__ == '__main__': | |
print(add(1, 2)) | |
print(add_lambda(1, 2)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ブログで作成しました。
【Python】簡素に記述するためにlambda(ラムダ式、無名関数)を使う
https://neko-py.com/python-lambda