Wave changes

This commit is contained in:
2026-03-27 15:39:35 +00:00
parent cb3e4c5809
commit bddb928ec2
253 changed files with 7056 additions and 1727 deletions

View File

@@ -0,0 +1,36 @@
:PROPERTIES:
:ID: 9d534e89-7f0b-494c-bff6-7b3be05b85d1
:END:
#+title: python-lambda
#+filetags: :python:notes:functions:
A lambda function is a small anonymous function.
A lambda function can take any number of arguments, but can only have one expression.
Syntax:
*lambda arguments : expression*
The expression is executed and the result is returned:
#+begin_src python :results output
# Add 10 to argument a, and return the result:
x = lambda a : a + 10
print(x(5))
# Multiply argument a with argument b and return the result:
y = lambda a, b : a * b
print(y(5, 6))
# Summarize argument a, b, and c and return the result:
z = lambda a, b, c : a + b + c
print(z(5, 6, 2))
#+end_src
#+RESULTS:
: 15
: 30
: 13