40
Awesome Team
Alexander Lyabah
http://www.checkio.org/user/oduvan/
Last seen 1 day ago
Member for 13 years, 10 months, 21 days
Difficulty Easy
love it!
Супер!
Только не стесняйся использовать более осмысленные имена переменных. Тогда код будет чуть легче читаем
* vowels
* consonants
* words
More
I think I saw something like this already, but instead of your like 6 it was replace expression.
More
good, except you don't need square brackets in sum. So you work with generator instead of list comprehension
More
I think having a simple marker `is_abs` can replaces lines 2 and 9 by:
is_abs = path.startswith('/')
if is_abs: return '/'
More
too many scopes.
def index_power(a, n):
if len(a)-1 < n:
return -1
else:
return a[n]**n
More
I've just found out that definition of `str.count` is different than `list.count`
>>> help(list.count)
count(...)
L.count(value) -> integer -- return number of occurrences of value
>>> help(str.count)
count(...)
S.count(sub[, start[, end]]) -> int
More
I think those two functions have something in common :)
Line 3: I think you don't need function list here
More
Thank you @veky, this is something new for me today
https://docs.python.org/3/library/contextlib.html#contextlib.suppress
More
I like the idea here of not using the third function
http://www.checkio.org/mission/min-max/publications/samulih/python-27/first/
More
You are always choosing name x-liner, and always right :)
More