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/binary/sl.py | |
parent | 8fd61c5d99aee8bf08871d306f1392b1bebd97aa (diff) |
- new exercises on recursion
- added text (lectures) on conditions and loops
Diffstat (limited to 'python/problems/recursion/binary/sl.py')
-rw-r--r-- | python/problems/recursion/binary/sl.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/python/problems/recursion/binary/sl.py b/python/problems/recursion/binary/sl.py new file mode 100644 index 0000000..8360a46 --- /dev/null +++ b/python/problems/recursion/binary/sl.py @@ -0,0 +1,30 @@ +import server +mod = server.problems.load_language('python', 'sl') + +id = 20808 +name = 'Binarno' + +description = '''\ +<p> +Napiši rekurzivno funkcijo <code>binary(n)</code>, ki kot argument prejme število +<code>n</code> in kot rezultat vrne niz s tem številom v dvojiškem zapisu. </p> + +<pre> +>>> binary(42) +'101010' +</pre> +''' + +plan = [] + +hint = { + 'final_hint': ['''\ +<p>Program je pravilen! <br> +</p> +'''], + + 'has_loop': ['''\ +<p>Program sicer deluje pravilno, vendar vsebuje zanko. +</p> +'''], +} |