summaryrefslogtreecommitdiff
path: root/python/problems/functions_and_modules/lists_sum/sl.py
diff options
context:
space:
mode:
authorMartin <martin@leo.fri1.uni-lj.si>2015-10-09 11:17:49 +0200
committerMartin <martin@leo.fri1.uni-lj.si>2015-10-09 11:17:49 +0200
commit84f3426c937d1bb9d44ba25a71706416fbb8b85d (patch)
tree84b064c8150b6bbd3422fb2c91c6121e0a01902c /python/problems/functions_and_modules/lists_sum/sl.py
parent45474b5c8cefa916aeb64e1c15a79f647a86d58c (diff)
Added several new problems.
They have no tests nor hints implemented.
Diffstat (limited to 'python/problems/functions_and_modules/lists_sum/sl.py')
-rw-r--r--python/problems/functions_and_modules/lists_sum/sl.py35
1 files changed, 35 insertions, 0 deletions
diff --git a/python/problems/functions_and_modules/lists_sum/sl.py b/python/problems/functions_and_modules/lists_sum/sl.py
new file mode 100644
index 0000000..4baa002
--- /dev/null
+++ b/python/problems/functions_and_modules/lists_sum/sl.py
@@ -0,0 +1,35 @@
+# coding=utf-8
+import server
+mod = server.problems.load_language('python', 'sl')
+
+
+id = 241
+name = 'Vsota seznamov'
+slug = 'Vsota seznamov'
+
+
+description = '''\
+<p>
+Podan je seznam seznamov, npr. <code>[[2, 4, 1], [3, 1], [], [8, 2], [1, 1, 1, 1]]</code>.
+NapiĊĦi funkcijo <code>lists_sum(xxs)</code>, ki v seznamu vrne vsote vseh elementov v posameznih podseznamih.
+Za gornji seznam naj funkcija vrne seznam <code>[7, 4, 0, 10, 4]</code>, saj je, na primer, <code>2 + 4 + 1 = 7</code>.
+<pre>
+>>> lists_sum([[1, 1, 1], [1, 1]])
+[3, 2]
+>>> lists_sum([[2, 4, 1], [3, 1], [], [8, 2], [1, 1, 1, 1]])
+[7, 4, 0, 10, 4]
+</pre>
+</p>'''
+
+plan = ['''\
+<p></p>
+''',
+ '''\
+<p></p>''']
+
+hint = {
+ 'final_hint': ['''\
+<p>Program je pravilen! <br>
+</p>
+'''],
+}