diff options
author | Martin Možina <martin.mozina@fri.uni-lj.si> | 2015-12-28 10:22:31 +0100 |
---|---|---|
committer | Martin Možina <martin.mozina@fri.uni-lj.si> | 2015-12-28 10:22:31 +0100 |
commit | 4cdea335b0951e3c12dfb7b906f958d6b5be25c6 (patch) | |
tree | 557575c8c73d1830b5025757cbd37edcec785844 /python | |
parent | bb49b7add4e63f8cb10130ed860107e5eda95018 (diff) |
New plans for palindromic numbers.
Diffstat (limited to 'python')
-rw-r--r-- | python/problems/functions/palindrome/sl.py | 4 | ||||
-rw-r--r-- | python/problems/functions/palindromic_numbers/sl.py | 26 |
2 files changed, 24 insertions, 6 deletions
diff --git a/python/problems/functions/palindrome/sl.py b/python/problems/functions/palindrome/sl.py index e005057..9ddba0d 100644 --- a/python/problems/functions/palindrome/sl.py +++ b/python/problems/functions/palindrome/sl.py @@ -20,10 +20,10 @@ False </p>''' plan = ['''\ -<p></p> +<p>Niz je palindrom, če je enak obrnjenemu nizu. Kako bi obrnil niz?</p> ''', '''\ -<p></p>'''] +<p>s[::-1]</p>'''] hint = { 'final_hint': ['''\ diff --git a/python/problems/functions/palindromic_numbers/sl.py b/python/problems/functions/palindromic_numbers/sl.py index 8d64bab..0ba6b2e 100644 --- a/python/problems/functions/palindromic_numbers/sl.py +++ b/python/problems/functions/palindromic_numbers/sl.py @@ -17,11 +17,29 @@ ki ga lahko dobimo kot produkt dveh tromestnih števil. Vir: Project Euler, <a href="http://projecteuler.net/index.php?section=problems&id=4">Problem 4</a>. </p>''' -plan = ['''\ -<p></p> -''', +num_to_str = [ '''\ -<p></p>'''] +<p>Ali je niz palindrom, že znamo ugotoviti. To smo se naučili pri prejšnji nalogi.</p>''', + '''\ +<p>Kako bi spremenil število v niz?</p>''', + '''\ +<code> +niz = str(stevilo) +</code>'''] + +double_loop = [ + '''\ +<p>Preizkusiti moraš produkte vseh kombinacij tromestnih števil.</p>''', + '''\ +<p>Potrebna bo dvojna zanka.</p>''', + '''\ +<code> +for st1 in range(100, 1000): + for st2 in range(100, 1000): +</code>'''] + +plan = [num_to_str, + double_loop] hint = { 'final_hint': ['''\ |