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

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

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

Резултати

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

Код

DOGE_WORDS = 'wow', 'lol', 'so', 'such', 'much', 'very'
def count_doge_words(words):
count = 0
for word in words.split():
count += word.lower() in DOGE_WORDS
return count
def transform(number):
if not number % 15:
return 'suchmuch'
elif not number % 3:
return 'such'
elif not number % 5:
return 'much'
else:
return str(number)
def wow_such_much(start, end):
return [transform(unit) for unit in range(start, end)]

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

...............
----------------------------------------------------------------------
Ran 15 tests in 0.007s

OK

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

Иван обнови решението на 07.03.2014 00:03 (преди над 10 години)

+DOGE_WORDS = ('wow', 'lol', 'so', 'such', 'much', 'very')
+
+
+def count_doge_words(words):
+ count = 0
+ for word in words.split():
+ count += word in DOGE_WORDS
+ return count
+
+def transform(number):
+ if not number % 15:
+ return 'suchmuch'
+ elif not number % 3:
+ return 'such'
+ elif not number % 5:
+ return 'much'
+ else:
+ return str(number)
+
+def wow_such_much(start, end):
+ return [transform(unit) for unit in range(start, end)]

Иван обнови решението на 08.03.2014 14:16 (преди над 10 години)

DOGE_WORDS = ('wow', 'lol', 'so', 'such', 'much', 'very')
def count_doge_words(words):
count = 0
for word in words.split():
- count += word in DOGE_WORDS
+ count += word.lower() in DOGE_WORDS
return count
def transform(number):
if not number % 15:
return 'suchmuch'
elif not number % 3:
return 'such'
elif not number % 5:
return 'much'
else:
return str(number)
def wow_such_much(start, end):
return [transform(unit) for unit in range(start, end)]

Иван обнови решението на 10.03.2014 23:29 (преди над 10 години)

-DOGE_WORDS = ('wow', 'lol', 'so', 'such', 'much', 'very')
+DOGE_WORDS = 'wow', 'lol', 'so', 'such', 'much', 'very'
def count_doge_words(words):
count = 0
for word in words.split():
count += word.lower() in DOGE_WORDS
return count
def transform(number):
if not number % 15:
return 'suchmuch'
elif not number % 3:
return 'such'
elif not number % 5:
return 'much'
else:
return str(number)
def wow_such_much(start, end):
return [transform(unit) for unit in range(start, end)]