Difference between revisions of "Python/scripts"

From Christoph's Personal Wiki
Jump to: navigation, search
(New page: This article will list a bunch of quick-and-dirty Python tips-and-tricks, examples, code, etc. ==Lambda functions== In stead of creating a new function of f(x): return x + 1 You coul...)
(No difference)

Revision as of 23:13, 10 March 2009

This article will list a bunch of quick-and-dirty Python tips-and-tricks, examples, code, etc.

Lambda functions

In stead of creating a new function of

f(x): return x + 1

You could use a lambda function inline, like so:

function_var = lambda x: x + 1
>>> print function_var(2)
3