Решение на doge от Иван Георгиев

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

Към профила на Иван Георгиев

Резултати

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

Код

def wow_such_much(start, end):
super_duper = []
for a in range(start, end):
if a % 3 == 0 and a % 5 == 0:
super_duper.append('suchmuch')
elif a % 3 == 0:
super_duper.append('such')
elif a % 5 == 0:
super_duper.append('much')
else:
super_duper.append(str(a))
return super_duper
def count_doge_words(sentence):
count = 0
parasites = ['wow', 'lol', 'so', 'such', 'much', 'very']
for word in sentence.split():
if word in parasites:
count += 1
return count

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

...............
----------------------------------------------------------------------
Ran 15 tests in 0.009s

OK

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

Иван обнови решението на 12.03.2014 16:18 (преди около 10 години)

+def wow_such_much(start, end):
+ super_duper = []
+ for a in range(start, end):
+ if a % 3 == 0 and a % 5 == 0:
+ super_duper.append('suchmuch')
+ elif a % 3 == 0:
+ super_duper.append('such')
+ elif a % 5 == 0:
+ super_duper.append('much')
+ else:
+ super_duper.append(str(a))
+ return super_duper
+
+def count_doge_words(sentence):
+ count = 0
+ parasites = ['wow', 'lol', 'so', 'such', 'much', 'very']
+ for word in sentence.split():
+ if word in parasites:
+ count += 1
+ return count