Решение на doge от Ангел Новоселски

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

Към профила на Ангел Новоселски

Резултати

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

Код

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

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

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

OK

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

Ангел обнови решението на 07.03.2014 15:51 (преди над 10 години)

+def wow_such_much(start, end):
+ returnlist=[]
+ for i in range(start , end):
+ if i%3==0 and i%5==0:
+ returnlist.append('suchmuch')
+ elif i%3==0:
+ returnlist.append('such')
+ elif i%5==0:
+ returnlist.append('much')
+ else:
+ returnlist.append(str(i))
+ print(returnlist)
+
+
+def count_doge_words(a):
+ words = a.split()
+ print(words.count('wow') + words.count('lol') + words.count('so') + words.count('such') + words.count('much') + words.count('very'))

Ангел обнови решението на 07.03.2014 16:57 (преди над 10 години)

def wow_such_much(start, end):
- returnlist=[]
+ result=[]
for i in range(start , end):
if i%3==0 and i%5==0:
- returnlist.append('suchmuch')
+ result.append('suchmuch')
elif i%3==0:
- returnlist.append('such')
+ result.append('such')
elif i%5==0:
- returnlist.append('much')
+ result.append('much')
else:
- returnlist.append(str(i))
- print(returnlist)
+ result.append(str(i))
+ return result
def count_doge_words(a):
words = a.split()
- print(words.count('wow') + words.count('lol') + words.count('so') + words.count('such') + words.count('much') + words.count('very'))
+ return words.count('wow') + words.count('lol') + words.count('so') + words.count('such') + words.count('much') + words.count('very')
+count_doge_words("wowowowowow wow lol")

Ангел обнови решението на 07.03.2014 19:16 (преди над 10 години)

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