diff options
author | Martin Možina <martin.mozina@fri.uni-lj.si> | 2016-08-24 15:32:22 +0200 |
---|---|---|
committer | Martin Možina <martin.mozina@fri.uni-lj.si> | 2016-08-24 15:32:22 +0200 |
commit | 12378810ee9207536bfa0c264c1bf2a2b0296171 (patch) | |
tree | 902e226e249a5369928e3fbc7e85739e14448b46 /python/problems/dictionaries/following_words/sl.py | |
parent | c2e782122d52acea0e69f8a5a92b40bbbb7072e5 (diff) |
Added several new exercises for Python (related to dictionaries and sets).
Diffstat (limited to 'python/problems/dictionaries/following_words/sl.py')
-rw-r--r-- | python/problems/dictionaries/following_words/sl.py | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/python/problems/dictionaries/following_words/sl.py b/python/problems/dictionaries/following_words/sl.py new file mode 100644 index 0000000..b9d6740 --- /dev/null +++ b/python/problems/dictionaries/following_words/sl.py @@ -0,0 +1,36 @@ +import server +mod = server.problems.load_language('python', 'sl') + + +id = 20610 +name = 'Sledeče besede' + +description = '''\ +<p> +Napišite funkcijo <code>following_words(txt)</code>, ki za vsako besedo <code>b</code> +v nizu <code>txt</code> zgradi seznam besed, ki v tekstu nastopijo za +besedo <code>b</code>. Nekaj primerov: +<pre> +>>> following_words('in in in in') +{'in': ['in', 'in', 'in']} +</pre> +V besedilu se pojavi samo beseda <code>in</code>; beseda <code>in</code> se pojavi +na treh mestih za <code>in</code>. +<pre> +>>> following_words('in to in ono in to smo mi') +{'smo': ['mi'], 'to': ['in', 'smo'], 'ono': ['in'], 'in': ['to', 'ono', 'to']} +</pre> +Za besedo <code>smo</code> se pojavi samo beseda <code>mi</code>, medtem ko se +recimo za besedo <code>to</code> pojavita tako beseda <code>smo</code> kot +tudi beseda <code>in</code>. +</p> +''' + +plan = [] + +hint = { + 'final_hint': ['''\ +<p>Program je pravilen! <br> +</p> +'''], +} |