Решение на doge от Янислав Василев

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

Към профила на Янислав Василев

Резултати

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

Код

def wow_such_much(start, end):
result = []
for number in range(start, end):
if number % 15 == 0:
result.append("suchmuch")
elif number % 5 == 0:
result.append("much")
elif number % 3 == 0:
result.append("such")
else:
result.append(str(number))
return result
def count_doge_words(string):
words = string.split(" ")
count = 0
for word in words:
if word in ("such", "lol", "wow", "so", "very", "much"):
count += 1
return count

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

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

OK

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

Янислав обнови решението на 11.03.2014 00:48 (преди над 10 години)

+def wow_such_much(start, end):
+ result = []
+ for number in range(start, end):
+ if number % 15 == 0:
+ result.append("suchmuch")
+ continue
+ if number % 5 == 0:
+ result.append("much")
+ continue
+ if number % 3 == 0:
+ result.append("such")
+ continue
+ result.append(str(number))
+ return result
+def count_doge_words(string):
+ words = string.split(" ")
+ count = 0
+ for word in words:
+ if word in ("such","lol","wow","so","very","much"):
+ count += 1
+ return count

Янислав обнови решението на 11.03.2014 13:13 (преди над 10 години)

def wow_such_much(start, end):
result = []
for number in range(start, end):
if number % 15 == 0:
result.append("suchmuch")
- continue
- if number % 5 == 0:
+ elif number % 5 == 0:
result.append("much")
- continue
- if number % 3 == 0:
+ elif number % 3 == 0:
result.append("such")
- continue
- result.append(str(number))
+ else:
- return result
+ result.append(str(number))
-def count_doge_words(string):
+ return result
- words = string.split(" ")
- count = 0
- for word in words:
- if word in ("such","lol","wow","so","very","much"):
- count += 1
- return count

Янислав обнови решението на 11.03.2014 13:14 (преди над 10 години)

def wow_such_much(start, end):
result = []
for number in range(start, end):
if number % 15 == 0:
result.append("suchmuch")
elif number % 5 == 0:
result.append("much")
elif number % 3 == 0:
result.append("such")
else:
result.append(str(number))
- return result
+ return result
+def count_doge_words(string=""):
+ words = string.split(" ")
+ count = 0
+ for word in words:
+ if word in ("such","lol","wow","so","very","much"):
+ count += 1
+ return count

Янислав обнови решението на 11.03.2014 13:17 (преди над 10 години)

def wow_such_much(start, end):
+
result = []
for number in range(start, end):
if number % 15 == 0:
result.append("suchmuch")
elif number % 5 == 0:
result.append("much")
elif number % 3 == 0:
result.append("such")
else:
result.append(str(number))
return result
+
def count_doge_words(string=""):
+
words = string.split(" ")
count = 0
for word in words:
if word in ("such","lol","wow","so","very","much"):
count += 1
return count

Янислав обнови решението на 11.03.2014 13:17 (преди над 10 години)

def wow_such_much(start, end):
result = []
for number in range(start, end):
if number % 15 == 0:
result.append("suchmuch")
elif number % 5 == 0:
result.append("much")
elif number % 3 == 0:
result.append("such")
else:
result.append(str(number))
return result
-def count_doge_words(string=""):
+def count_doge_words(string):
words = string.split(" ")
count = 0
for word in words:
if word in ("such","lol","wow","so","very","much"):
count += 1
return count

Янислав обнови решението на 11.03.2014 23:06 (преди над 10 години)

def wow_such_much(start, end):
result = []
for number in range(start, end):
if number % 15 == 0:
result.append("suchmuch")
elif number % 5 == 0:
result.append("much")
elif number % 3 == 0:
result.append("such")
else:
result.append(str(number))
return result
+
def count_doge_words(string):
words = string.split(" ")
count = 0
for word in words:
- if word in ("such","lol","wow","so","very","much"):
+ if word in ("such", "lol", "wow", "so", "very", "much"):
count += 1
return count