Георги обнови решението на 07.03.2014 01:33 (преди над 11 години)
+def wow_such_much(start, end):
+    """
+    Take start and end integer arguments and generate a list
+    containing the arithmetic progression. Return the list of
+    those integers but if the number is divided by 3 switch the
+    value with such if divided by 5 with much and if divided by
+    15 with suchmuch
+    """
+    provided_list = range(start, end)
+    divisors = [(3, 'such'), (5, 'much'), (3*5, 'suchmuch')]
+    changed_list = []
+
+    for i in provided_list:
+        new_value = i
+        if i == 0:
+            changed_list.append(new_value)
+            continue
+        for d in divisors:
+            if (i / d[0]).is_integer():
+                new_value = d[1]
+            else:
+                pass
+        changed_list.append(new_value)
+    return changed_list
+
+def count_doge_words(sentence):
+    """Take a sentence as argument and return a positive or
+    equal to zero integer which represent how many times
+    specified words are found in it
+    """
+    search_words = ['wow', 'lol', 'so', 'such', 'much', 'very']
+    counter = 0
+
+    for w in sentence.split(' '):
+        if w in search_words:
+            counter += 1
+    return counter
Погледни пак условието
- Числата във върнатия списък трябва също да са конвертирани до низове.
- Погледни какво прави операторът %в python.
- Помисли дали тези вложени if-ове и for цикли могат да се заменят с по-проста конструкция
