diff options
author | Martin Možina <martin.mozina@fri.uni-lj.si> | 2016-10-11 14:39:50 +0200 |
---|---|---|
committer | Martin Možina <martin.mozina@fri.uni-lj.si> | 2016-10-11 14:39:50 +0200 |
commit | 29bc34810cb1d1fbd208f6b5f2dad73188ca7f12 (patch) | |
tree | 0501d9274c6f87aa8a0aa4d273c364f0923d9063 /python/problems/recursion/sum/sl.py | |
parent | 8fd61c5d99aee8bf08871d306f1392b1bebd97aa (diff) |
- new exercises on recursion
- added text (lectures) on conditions and loops
Diffstat (limited to 'python/problems/recursion/sum/sl.py')
-rw-r--r-- | python/problems/recursion/sum/sl.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/python/problems/recursion/sum/sl.py b/python/problems/recursion/sum/sl.py new file mode 100644 index 0000000..e23bd97 --- /dev/null +++ b/python/problems/recursion/sum/sl.py @@ -0,0 +1,32 @@ +import server +mod = server.problems.load_language('python', 'sl') + +id = 20807 +name = 'Vsota seznama' + +description = '''\ +<p> +Napiši funkcijo <code>sum(xs)</code>, ki sešteje elemente vgnezdenega seznama xs. +Pomagajte si s funkcijo isinstance.</p> +<pre> +>>> isinstance([1, 2, 3], list) +True +>>> isinstance(1, list) +False +>>> sum([]) +0 +>>> sum([1, 2, 3, 4, 5]) +15 +>>> sum([1, [], [2, 3, [4]], 5]) +15 +</pre> +''' + +plan = [] + +hint = { + 'final_hint': ['''\ +<p>Program je pravilen! <br> +</p> +'''], +} |