Венцислав обнови решението на 09.03.2014 02:26 (преди над 10 години)
+def wow_such_much(start, end):
+ item_list = []
+ for num in range(start, end):
+ devision_by_3 = (num % 3) == 0
+ devision_by_5 = (num % 5) == 0
+ if devision_by_3 and not devision_by_5:
+ item_list.append('such')
+ elif not devision_by_3 and devision_by_5:
+ item_list.append('much')
+ elif devision_by_3 and devision_by_5:
+ item_list.append('suchmuch')
+ else :
+ item_list.append(str(num))
+ return item_list
+
+def count_doge_words(sentence):
+ counter = 0
+ bad_words = ['wow', 'lol', 'so', 'such', 'much', 'very']
+ sentence = sentence.split(' ')
+ for word in sentence:
+ if word in bad_words:
+ counter += 1
+ return counter
Нямаш нужда от devision_by_3
и devision_by_5
, можеш директно да си използваш условието в if
-а