summaryrefslogtreecommitdiff
path: root/python/problems/functions_and_modules/longest_word/sl.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/problems/functions_and_modules/longest_word/sl.py')
-rw-r--r--python/problems/functions_and_modules/longest_word/sl.py32
1 files changed, 28 insertions, 4 deletions
diff --git a/python/problems/functions_and_modules/longest_word/sl.py b/python/problems/functions_and_modules/longest_word/sl.py
index eb85509..0d4b057 100644
--- a/python/problems/functions_and_modules/longest_word/sl.py
+++ b/python/problems/functions_and_modules/longest_word/sl.py
@@ -16,11 +16,35 @@ Napiši funkcijo <code>longest(s)</code>, ki vrne najdaljšo besedo v nizu <code
'podgan'
</p>'''
-plan = ['''\
-<p></p>
-''',
+split = ['''\
+<p>
+Uporabi metodo <code>split</code>, ki razdeli niz na podnize.</p>''',
+ '''\
+<pre>
+>>> st = 'an ban pet podgan'
+>>> st.split()
+['an', 'ban', 'pet, 'podgan']
+</pre>
+''']
+
+len_func = [
'''\
-<p></p>''']
+<p>Funkcija <code>len</code> vrne dolžino niza (pa tudi seznama, terke, itd.)</p>''']
+
+
+
+
+plan = [split,
+'''\
+<pre>
+def longest(s):
+ z zanko čez vse besede
+ če je beseda daljša od trenutno najdaljše besede
+ ustrezno spremeni najdaljšo besedo
+ vrni rezultat
+</pre>
+''',
+ len_func]
hint = {
'final_hint': ['''\