The Python Game Book

code games. learn Python.

User Tools

Site Tools


Sidebar

Github:

en:glossary:l:lambda

lambda

small anonymous function

mean = lambda x : sum(x) / len(x)

#Now we could call it just as we would any method in the Python programming language:

x = [5, 10, 15, 20]
print(mean(x))

en/glossary/l/lambda.txt · Last modified: 2021/01/18 18:36 by horst