Решение на doge от Таня Христова

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

Към профила на Таня Христова

Резултати

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

Код

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

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

...............
----------------------------------------------------------------------
Ran 15 tests in 0.008s

OK

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

Таня обнови решението на 08.03.2014 01:02 (преди около 10 години)

+def wow_such_much(start, end):
+
+ arr = list(range(start, end))
+ arr = ["suchmuch" if (n%3==0 and n%5==0) else n for n in arr]
+ arr = ["such" if str(n).isdigit() and n%3==0 else n for n in arr]
+ arr = ["much" if str(n).isdigit() and n%5==0 else n for n in arr]
+ arr = [str(n) for n in arr]
+ return arr
+
+
+def count_doge_words(text):
+
+ parasites = ["wow", "lol", "so ", "such", "much", "very"]
+ count = 0
+ for word in text.split(" "):
+ if word in parasites:
+ count+=1
+ return count

Таня обнови решението на 08.03.2014 01:09 (преди около 10 години)

def wow_such_much(start, end):
arr = list(range(start, end))
arr = ["suchmuch" if (n%3==0 and n%5==0) else n for n in arr]
arr = ["such" if str(n).isdigit() and n%3==0 else n for n in arr]
arr = ["much" if str(n).isdigit() and n%5==0 else n for n in arr]
arr = [str(n) for n in arr]
return arr
def count_doge_words(text):
- parasites = ["wow", "lol", "so ", "such", "much", "very"]
+ parasites = ["wow", "lol", "so", "such", "much", "very"]
count = 0
for word in text.split(" "):
if word in parasites:
count+=1
return count

Таня обнови решението на 09.03.2014 20:25 (преди около 10 години)

def wow_such_much(start, end):
-
- arr = list(range(start, end))
- arr = ["suchmuch" if (n%3==0 and n%5==0) else n for n in arr]
- arr = ["such" if str(n).isdigit() and n%3==0 else n for n in arr]
- arr = ["much" if str(n).isdigit() and n%5==0 else n for n in arr]
- arr = [str(n) for n in arr]
- return arr
+ return ["suchmuch" if x%3==0 and x%5==0 else "much" if x%5==0 else "such" if x%3==0 else str(x) for x in range(1, 16)]
def count_doge_words(text):
parasites = ["wow", "lol", "so", "such", "much", "very"]
count = 0
for word in text.split(" "):
if word in parasites:
count+=1
return count

Таня обнови решението на 09.03.2014 20:29 (преди около 10 години)

def wow_such_much(start, end):
- return ["suchmuch" if x%3==0 and x%5==0 else "much" if x%5==0 else "such" if x%3==0 else str(x) for x in range(1, 16)]
+ return ["suchmuch" if x%3==0 and x%5==0 else "much" if x%5==0 else "such" if x%3==0 else str(x) for x in range(start, end)]
-
def count_doge_words(text):
-
parasites = ["wow", "lol", "so", "such", "much", "very"]
count = 0
for word in text.split(" "):
if word in parasites:
count+=1
return count