summaryrefslogtreecommitdiff
path: root/python/problems/dictionaries/grandchildren/sl.py
diff options
context:
space:
mode:
authorMartin Možina <martin.mozina@fri.uni-lj.si>2016-08-24 15:32:22 +0200
committerMartin Možina <martin.mozina@fri.uni-lj.si>2016-08-24 15:32:22 +0200
commit12378810ee9207536bfa0c264c1bf2a2b0296171 (patch)
tree902e226e249a5369928e3fbc7e85739e14448b46 /python/problems/dictionaries/grandchildren/sl.py
parentc2e782122d52acea0e69f8a5a92b40bbbb7072e5 (diff)
Added several new exercises for Python (related to dictionaries and sets).
Diffstat (limited to 'python/problems/dictionaries/grandchildren/sl.py')
-rw-r--r--python/problems/dictionaries/grandchildren/sl.py33
1 files changed, 33 insertions, 0 deletions
diff --git a/python/problems/dictionaries/grandchildren/sl.py b/python/problems/dictionaries/grandchildren/sl.py
new file mode 100644
index 0000000..b24c315
--- /dev/null
+++ b/python/problems/dictionaries/grandchildren/sl.py
@@ -0,0 +1,33 @@
+import server
+mod = server.problems.load_language('python', 'sl')
+
+
+id = 20608
+name = 'Vnuki (družinsko drevo 3)'
+
+description = '''\
+<p>
+Napišite funkcijo <code>grandchildren(tree, name)</code>, ki v družinskem drevesu <code>tree</code>
+vrne seznam vseh vnukov in vnukinj osebe. V primeru, da oseba nima vnukov, vrnite prazen seznam.
+</p>
+
+<p>
+Družinsko drevo <code>tree</code> je slovar, kjer ključi predstavljajo imena
+staršev, vrednosti pa so njihovi otroci. Primer iz prejšnje naloge:
+<pre>
+>>> tree = {'renee': ['rob', 'bob'], 'ken': ['suzan'], 'rob': ['jim'],
+ 'sid': ['rob', 'bob'], ... , 'bob': ['mary', 'tom', 'judy']}
+>>> grandchildren(tree, 'renee')
+['jim', 'mary', 'tom', 'judy']
+</pre>
+</p>
+'''
+
+plan = []
+
+hint = {
+ 'final_hint': ['''\
+<p>Program je pravilen! <br>
+</p>
+'''],
+}