diff options
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': ['''\ |