summaryrefslogtreecommitdiff
path: root/python/problems/functions_and_modules
diff options
context:
space:
mode:
authorMartin Možina <martin.mozina@fri.uni-lj.si>2015-10-29 16:08:34 +0100
committerMartin Možina <martin.mozina@fri.uni-lj.si>2015-10-29 16:08:34 +0100
commit5db9e65c81bdf81ed4030040ff3666362e860d10 (patch)
tree70e58eb6d55d9689d3e8b49c9bcadbc7f8458b56 /python/problems/functions_and_modules
parentec7740df5a94d90758d688ac0f753e12de931360 (diff)
Bugfix.
Added some hints.
Diffstat (limited to 'python/problems/functions_and_modules')
-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': ['''\