40
Awesome Team
Alexander Lyabah
http://www.checkio.org/user/oduvan/
Last seen 1 day ago
Member for 13 years, 10 months, 22 days
Difficulty Easy
love it!
Sara, same as your friend.
You are using too many scopes.
Not all of those are necessary. this is one of the thing that makes Python beautiful.
More
well.. I must say this one
res, sum, i = res + [k], sum + k, i + 1
looks odd :)
More
should be __new_arr__ instead of __newArr__
...
PS: You love spaces, right?
More
Here you assume that you have many arguments
*args
and here
for arg in args
but than you say there are only two
a, b =
and here
a == b
which doesn't make sense.
Why don't you go farther?
tr_args = ["".join(
return len(set(the_list))==1
More
This is like a smile-collection here https://py.checkio.org/user/blankplank/solutions/ :)
More
Как вариант к улучшению
Если первое условие заканчивается на `return` то `else` можно не использовать. Поэтому решение можно переписать так
if text.count(symbol) < 2:
return None
x = text.index(symbol) + 1
return text.index(symbol,x)
понимаешь почему?
More
немного по условиям еще подсказка
return None
можно просто заменить на
return
а условия можно просто объединить через `or`
итого это
if text.find(symbol) == -1:
return None
if text.count(symbol) == 1:
return None
можно заменить на
if text.find(symbol)
More
Попробуй еще сделать вариант, где мы проверяем в начале, что есть 2 символа и тогда уже делаем все необходимые вычисления.
More
text.split(symbol)
используется 3 раза. Действительно имеет смысл задуматься о том, чтобы сделать отдельную переменную для этого.
More
if condition:
return True
else:
return False
is the same as
return condition
or
return bool(condition)
More
Well, it might be sometime confusing that text1 and text2 are not even strings
More
line 3: do we really? really-really wants to use _ as a variable name?
More
в третьей строке тебе не надо приводить использовать функцию list. Понимаешь
почему?
More