Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Martin Mareš
prm1
Commits
1f703651
Commit
1f703651
authored
Nov 10, 2020
by
Martin Mareš
Browse files
Comprehensions: Hezčí řešení příkladu s řazením slov podle délky
parent
bcf1ec14
Changes
1
Show whitespace changes
Inline
Side-by-side
07-compr/priklady.py
View file @
1f703651
...
...
@@ -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
)
]
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment