Skip to content
Snippets Groups Projects
Commit f7ad1bd3 authored by Martin Mareš's avatar Martin Mareš
Browse files

Řezy: Řešení příkladů

parent 6d1d8513
No related branches found
No related tags found
No related merge requests found
#!/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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment