Решение на doge от Тихомир Янев

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

Към профила на Тихомир Янев

Резултати

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

Код

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

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

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

OK

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

Тихомир обнови решението на 06.03.2014 13:48 (преди над 10 години)

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

Тихомир обнови решението на 06.03.2014 14:25 (преди над 10 години)

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

Тихомир обнови решението на 06.03.2014 21:10 (преди над 10 години)

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

Тихомир обнови решението на 06.03.2014 21:13 (преди над 10 години)

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

Тихомир обнови решението на 10.03.2014 23:03 (преди над 10 години)

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