Решение на doge от Атанас Филчев

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

Към профила на Атанас Филчев

Резултати

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

Код

def wow_such_much(start, end):
ret_list_str = []
for x in range(start, end):
val = str(x);
if x is not 0:
if x % 3 == 0 and x%5 == 0:
val = 'suchmuch'
elif x % 5 == 0:
val = 'much'
elif x % 3 == 0:
val = 'such'
ret_list_str.append(val)
return ret_list_str
def count_doge_words(instr):
doge_words = ['wow', 'lol', 'so', 'such', 'much', 'very']
split_input = instr.split()
count_dodge_words = 0
for word in split_input:
if word in doge_words:
count_dodge_words += 1
return count_dodge_words

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

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

OK

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

Атанас обнови решението на 06.03.2014 14:58 (преди над 10 години)

+def wow_such_much(start,end):
+
+ ret_list_str=[]
+ for x in range(start,end):
+ val = str(x);
+ if x is not 0:
+ if x%3 == 0 and x%5 == 0:
+ val= 'suchmuch'
+ elif x%5 == 0:
+ val = 'much'
+ elif x%3 == 0:
+ val = 'such'
+ ret_list_str.append(val)
+
+
+ return ret_list_str
+
+
+def count_doge_words(instr):
+ doge_words = ['wow', 'lol', 'so', 'such', 'much', 'very']
+ count_dodge_words = 0
+ for doge_word in doge_words:
+ if doge_word in instr:
+ count_dodge_words +=1
+ return count_dodge_words

Атанас обнови решението на 06.03.2014 15:25 (преди над 10 години)

def wow_such_much(start,end):
ret_list_str=[]
for x in range(start,end):
val = str(x);
if x is not 0:
if x%3 == 0 and x%5 == 0:
val= 'suchmuch'
elif x%5 == 0:
val = 'much'
elif x%3 == 0:
val = 'such'
ret_list_str.append(val)
return ret_list_str
def count_doge_words(instr):
doge_words = ['wow', 'lol', 'so', 'such', 'much', 'very']
+ split_input = instr.split()
count_dodge_words = 0
- for doge_word in doge_words:
- if doge_word in instr:
+ for word in split_input:
+ if word in doge_words:
count_dodge_words +=1
- return count_dodge_words
+ return count_dodge_words

Атанас обнови решението на 06.03.2014 15:34 (преди над 10 години)

-def wow_such_much(start,end):
-
- ret_list_str=[]
- for x in range(start,end):
+def wow_such_much(start, end):
+ ret_list_str = []
+ for x in range(start, end):
val = str(x);
if x is not 0:
if x%3 == 0 and x%5 == 0:
- val= 'suchmuch'
+ val = 'suchmuch'
elif x%5 == 0:
val = 'much'
elif x%3 == 0:
val = 'such'
ret_list_str.append(val)
-
-
return ret_list_str
def count_doge_words(instr):
doge_words = ['wow', 'lol', 'so', 'such', 'much', 'very']
split_input = instr.split()
count_dodge_words = 0
for word in split_input:
if word in doge_words:
- count_dodge_words +=1
+ count_dodge_words += 1
return count_dodge_words

Атанас обнови решението на 06.03.2014 15:48 (преди над 10 години)

def wow_such_much(start, end):
ret_list_str = []
for x in range(start, end):
val = str(x);
if x is not 0:
- if x%3 == 0 and x%5 == 0:
+ if x % 3 == 0 and x%5 == 0:
val = 'suchmuch'
- elif x%5 == 0:
+ elif x % 5 == 0:
val = 'much'
- elif x%3 == 0:
+ elif x % 3 == 0:
val = 'such'
ret_list_str.append(val)
return ret_list_str
def count_doge_words(instr):
doge_words = ['wow', 'lol', 'so', 'such', 'much', 'very']
split_input = instr.split()
count_dodge_words = 0
for word in split_input:
if word in doge_words:
count_dodge_words += 1
- return count_dodge_words
+ return count_dodge_words