diff options
Diffstat (limited to 'python/problems')
-rw-r--r-- | python/problems/functions_and_modules/similarity/sl.py | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/python/problems/functions_and_modules/similarity/sl.py b/python/problems/functions_and_modules/similarity/sl.py index 8aaf0b0..d3bb95c 100644 --- a/python/problems/functions_and_modules/similarity/sl.py +++ b/python/problems/functions_and_modules/similarity/sl.py @@ -25,11 +25,25 @@ robot </pre> </p>''' +range_for = ['''\ +<p>S <code>for</code> prehodi vse indekse in na vsakem koraku primerjaj ali sta +črki (pri trenutnem indeksu) enaki.</p>''', + '''\ +<p>Zanka s <code>for</code>:</p> +<pre> +for i in range(min(len(s1), len(s2))): +</pre>'''] + plan = ['''\ -<p></p> -''', +<p>Naloge se lahko lotiš na dva načina: 1) z <code>zip</code> ustvariš pare +soležnih elementov, ali 2) uporabiš funkcijo <code>range</code> in primerjaš po indeksih. </p>''', '''\ -<p></p>'''] +<p>Zanka z <code>zip</code>: </p> +<pre> +for v1, v2 in zip(s1, s2): +</pre>''', + range_for] + hint = { 'final_hint': ['''\ |