Решение на doge от Йордан Данчев

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

Към профила на Йордан Данчев

Резултати

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

Код

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

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

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

OK

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

Йордан обнови решението на 12.03.2014 15:37 (преди около 10 години)

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

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

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