From 84f3426c937d1bb9d44ba25a71706416fbb8b85d Mon Sep 17 00:00:00 2001 From: Martin Date: Fri, 9 Oct 2015 11:17:49 +0200 Subject: Added several new problems. They have no tests nor hints implemented. --- .../problems/functions_and_modules/lists_sum/sl.py | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 python/problems/functions_and_modules/lists_sum/sl.py (limited to 'python/problems/functions_and_modules/lists_sum/sl.py') 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 = '''\ +

+Podan je seznam seznamov, npr. [[2, 4, 1], [3, 1], [], [8, 2], [1, 1, 1, 1]]. +NapiĊĦi funkcijo lists_sum(xxs), ki v seznamu vrne vsote vseh elementov v posameznih podseznamih. +Za gornji seznam naj funkcija vrne seznam [7, 4, 0, 10, 4], saj je, na primer, 2 + 4 + 1 = 7. +

+>>> 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]
+
+

''' + +plan = ['''\ +

+''', + '''\ +

'''] + +hint = { + 'final_hint': ['''\ +

Program je pravilen!
+

+'''], +} -- cgit v1.2.1