Марио обнови решението на 07.03.2014 01:04 (преди над 10 години)
+# Returns the required behavior for the number
+def get_bahavior(number):
+ if number % 15 == 0:
+ return "suchmuch"
+ elif number % 3 == 0:
+ return "such"
+ elif number % 5 == 0:
+ return "much"
+ else:
+ return str(number)
+
+
+# Applies the behavior for the range
+def wow_such_much(start, end):
+ interval = []
+ interval.extend(range(start, end))
+ result = list(map(get_bahavior, interval))
+ return result
+
+
+# A list of doge words is provided
+def is_doge(word):
+ doge_words = ("wow", "lol", "so", "such", "much", "very")
+ return word in doge_words
+
+
+# Doge words repetition is counted
+def count_doge_words(sentence):
+ words = sentence.split()
+ return len(list(filter(is_doge, words)))
Доста хубаво и изчистено решение