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
Čermák Petr
Prm1
Commits
f7ad1bd3
Commit
f7ad1bd3
authored
Nov 12, 2019
by
Mareš Martin
Browse files
Řezy: Řešení příkladů
parent
6d1d8513
Changes
1
Show whitespace changes
Inline
Side-by-side
06-rezy/priklady.py
0 → 100644
View file @
f7ad1bd3
#!/usr/bin/env python3
def
otoc_retezec
(
r
):
return
r
[::
-
1
]
def
otoc_cislo
(
x
):
return
int
(
otoc_retezec
(
str
(
x
)))
def
spocitej_slova
(
radek
):
return
len
(
radek
.
split
())
def
spocitej_ruzna_slova
(
radek
):
slova
=
[]
for
slovo
in
radek
.
split
():
if
slovo
not
in
slova
:
slova
.
append
(
slovo
)
return
len
(
slova
)
def
vyhodnot_vyraz
(
vyraz
):
soucet
=
0
for
clen
in
vyraz
.
split
(
"+"
):
soucet
+=
int
(
clen
)
return
soucet
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