Commit f7ad1bd3 authored by Mareš Martin's avatar Mareš Martin
Browse files

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

parent 6d1d8513
#!/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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment