From 7dd2b4dc917fe26267c1db1f5f58585a5417cb8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Mo=C5=BEina?= Date: Sun, 18 Oct 2015 19:21:12 +0200 Subject: Added some plans to some problems. --- python/problems/lists_and_for/substrings/sl.py | 41 ++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) (limited to 'python/problems/lists_and_for/substrings') diff --git a/python/problems/lists_and_for/substrings/sl.py b/python/problems/lists_and_for/substrings/sl.py index 595aee8..6bf56bf 100644 --- a/python/problems/lists_and_for/substrings/sl.py +++ b/python/problems/lists_and_for/substrings/sl.py @@ -19,11 +19,48 @@ Vrstni red naj bo točno tak kot ga prikazuje primer. Začnemo s praznim nizom, nato pridejo na vrsto podnizi dolžine ena, dva, tri, ...

''' + +substring = ['''\ +

Del niza oz. del seznama dobimo z rezanjem

+''', + '''\ +

Za rezanje uporabi dvopičje

''', + '''\ +
+>>> s = "Rezanje"
+>>> s[:2]
+'Re'
+>>> s[2:]
+'zanje'
+>>> s[2:5]
+'zan'
+
'''] + plan = ['''\ -

+

Potrebujemo dvojno zanko.

''', '''\ -

'''] +

Prva zanka gre po dolžini podniza, druga po začetku podniza.

''', + '''\ +
+naredi seznam s praznim podnizom
+Z zanko pojdi od 0 do dolžine niza:
+    z zanko pojdi od 0 do dolžine podniza
+        v seznam dodaj ustrezen podniz 
+
''', + + '''\ +

Nov prazen seznam:

+
+xs = []
+
+''', + '''\ +

Zanka od 0 do n:

+
+for i in range(n):
+
''', + substring] hint = { 'final_hint': ['''\ -- cgit v1.2.1