Решение на doge от Минх Нгуен

Обратно към всички решения

Към профила на Минх Нгуен

Резултати

  • 6 точки от тестове
  • 6 отнети точки
  • 0 точки общо
  • 9 успешни тест(а)
  • 6 неуспешни тест(а)

Код

def wow_such_much(start, end):
result_list = []
for index in range(start, end):
if not index%3:
result_list.append("such")
elif not index%5:
result_list.append("much")
elif not index%15:
result_list.append("suchmuch")
else:
result_list.append(index)
return result_list
def count_doge_words(sentence):
count = 0
parasite_words = ['wow','lol','so','such','much','very']
for word in parasite_words:
if word in sentence:
count+=1
return count

Лог от изпълнението

▸ Покажи лога

История (1 версия и 1 коментар)

Минх обнови решението на 11.03.2014 18:32 (преди около 11 години)

▸ Покажи разликите
+def wow_such_much(start, end):
+ result_list = []
+ for index in range(start, end):
+ if not index%3:
+ result_list.append("such")
+ elif not index%5:
+ result_list.append("much")
+ elif not index%15:
+ result_list.append("suchmuch")
+ else:
+ result_list.append(index)
+ return result_list
+
+
+
+def count_doge_words(sentence):
+ count = 0
+ parasite_words = ['wow','lol','so','such','much','very']
+ for word in parasite_words:
+ if word in sentence:
+ count+=1
+ return count
+