From 1f70365132ee56d4b0ed84120d30d595e5ea848f Mon Sep 17 00:00:00 2001 From: Martin Mares <mj@ucw.cz> Date: Tue, 10 Nov 2020 13:54:28 +0100 Subject: [PATCH] =?UTF-8?q?Comprehensions:=20Hez=C4=8D=C3=AD=20=C5=99e?= =?UTF-8?q?=C5=A1en=C3=AD=20p=C5=99=C3=ADkladu=20s=20=C5=99azen=C3=ADm=20s?= =?UTF-8?q?lov=20podle=20d=C3=A9lky?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 07-compr/priklady.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/07-compr/priklady.py b/07-compr/priklady.py index db3470b..dc258a9 100644 --- a/07-compr/priklady.py +++ b/07-compr/priklady.py @@ -19,5 +19,4 @@ def nasobeni_matic(x, y): def slova_podle_delky(radek): dvojice = [ (len(slovo), slovo) for slovo in radek.split() ] - for _, slovo in sorted(dvojice): - print(slovo) + return [ slovo for _, slovo in sorted(dvojice) ] -- GitLab