diff options
author | Martin Možina <martin.mozina@fri.uni-lj.si> | 2015-12-28 10:59:12 +0100 |
---|---|---|
committer | Martin Možina <martin.mozina@fri.uni-lj.si> | 2015-12-28 10:59:12 +0100 |
commit | 7e3c3602f1c1619fc1666bc2a21179530a99f3f1 (patch) | |
tree | 9e9daa3f800357a6d5bbcc0f6262bb5d850ae33f /python/problems/functions | |
parent | 165c7165bb2184c9c9e0576a074ba4f29052bf8f (diff) |
Added basic plans to three problems.
Diffstat (limited to 'python/problems/functions')
-rw-r--r-- | python/problems/functions/divisors/sl.py | 15 | ||||
-rw-r--r-- | python/problems/functions/divisors_sum/sl.py | 4 | ||||
-rw-r--r-- | python/problems/functions/palindromic_numbers/sl.py | 6 |
3 files changed, 20 insertions, 5 deletions
diff --git a/python/problems/functions/divisors/sl.py b/python/problems/functions/divisors/sl.py index f0e25c4..b4f0070 100644 --- a/python/problems/functions/divisors/sl.py +++ b/python/problems/functions/divisors/sl.py @@ -12,7 +12,20 @@ description = '''\ <p> Napiši funkcijo <code>divisors(n)</code>, ki izpiše vse delitelje števila (brez samega sebe), ki ga vnese uporabnik.</p>''' -plan = [] +div_modulo = [ + '''\ +<p>Število <code>a</code> deli število <code>b</code>, če je ostanek +pri deljenju števil enak 0.</p>''', + '''\ +<pre> +if b % a == 0: +</pre>'''] + +plan = [ + '''\ +<p>Za vsa cela števila, ki so manjša od <code>n</code>, preveri, +če delijo <code>n</code>. Če delijo, jih izpiši. </p>''', + div_modulo] hint = { 'final_hint': ['''\ diff --git a/python/problems/functions/divisors_sum/sl.py b/python/problems/functions/divisors_sum/sl.py index 31cd369..f06b1dd 100644 --- a/python/problems/functions/divisors_sum/sl.py +++ b/python/problems/functions/divisors_sum/sl.py @@ -13,7 +13,9 @@ description = '''\ Napiši funkcijo <code>divisors_sum(n)</code>, ki vrne vsoto vseh deliteljev števila, ki ga vnese uporabnik. </p>''' -plan = [] +plan = ['''\ +<p>Ideja je ista kot pri izpisu vseh deliteljev. Tu števil ne +izpisujemo, temveč jih prištevamo vsoti in vsoto na koncu vrnemo.</p>'''] hint = { 'final_hint': ['''\ diff --git a/python/problems/functions/palindromic_numbers/sl.py b/python/problems/functions/palindromic_numbers/sl.py index 0ba6b2e..fef1d96 100644 --- a/python/problems/functions/palindromic_numbers/sl.py +++ b/python/problems/functions/palindromic_numbers/sl.py @@ -31,12 +31,12 @@ double_loop = [ '''\ <p>Preizkusiti moraš produkte vseh kombinacij tromestnih števil.</p>''', '''\ -<p>Potrebna bo dvojna zanka.</p>''', +<p>Potrebna bo dvojna zanka...</p>''', '''\ -<code> +<pre> for st1 in range(100, 1000): for st2 in range(100, 1000): -</code>'''] +</pre>'''] plan = [num_to_str, double_loop] |