From 12378810ee9207536bfa0c264c1bf2a2b0296171 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Mo=C5=BEina?= Date: Wed, 24 Aug 2016 15:32:22 +0200 Subject: Added several new exercises for Python (related to dictionaries and sets). --- python/problems/dictionaries/children/sl.py | 35 +++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 python/problems/dictionaries/children/sl.py (limited to 'python/problems/dictionaries/children/sl.py') diff --git a/python/problems/dictionaries/children/sl.py b/python/problems/dictionaries/children/sl.py new file mode 100644 index 0000000..2717a1b --- /dev/null +++ b/python/problems/dictionaries/children/sl.py @@ -0,0 +1,35 @@ +import server +mod = server.problems.load_language('python', 'sl') + + +id = 20607 +name = 'Otroci (družinsko drevo 2)' + +description = '''\ +

+Napišite funkcijo children(tree, name), ki v družinskem drevesu tree +vrne seznam vseh otrok osebe. V primeru, da oseba nima otrok, vrnite prazen seznam. +

+ +

+Družinsko drevo tree je slovar, kjer ključi predstavljajo imena +staršev, vrednosti pa so njihovi otroci. Primer iz prejšnje naloge: +

+>>> tree = {'renee': ['rob', 'bob'], 'ken': ['suzan'], 'rob': ['jim'],
+            'sid': ['rob', 'bob'], ... , 'bob': ['mary', 'tom', 'judy']}
+>>> children(tree, 'alice')
+['mary', 'tom', 'judy']
+>>> children(tree, 'mary')
+[]
+
+

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

Program je pravilen!
+

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