changeset 26:eabf7897f8d2 default tip

przykład z lambdą
author Radomir Dopieralski
date Wed, 31 Oct 2012 12:37:02 +0100
parents dc0d4213b909
children
files docs/Sortowanie
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/docs/Sortowanie	Wed Oct 31 12:36:10 2012 +0100
+++ b/docs/Sortowanie	Wed Oct 31 12:37:02 2012 +0100
@@ -8,6 +8,7 @@
 {{{#!python
 >>> import operator
 >>> a.sort(key=operator.itemgetter(1))
+>>> a.sort(key=lambda x: x[1]) # to samo
 >>> a
 [(3, 0), (0, 1), (1, 2)]
 }}}