16
Safwan_Samsudeen
4 14 37
1300/ 1445
Safwan Samsudeen
Last seen 2 years ago
Member for 3 years, 6 months, 22 days
Difficulty Normal
Best reviews / Newest reviews
Both sides-veky 1 1
Great solution. Is there any advantage to use this method over `statistics.median`? I saw your [other solution](https://py.checkio.org/mission/median/publications/veky/python-3/statistics/), really elegant, but is there any advantage to use this over that? More
generator expression-Sim0000 1
I didn't think of using a generator, I used a list comprehension inside of the `sum` function. Thanks! More
Update from prev. version-Pumba_UA 1
Why `OrderedDict`? Is there any advantage - other than meaning - in using it over `dict`? More
First-KlausWang91 1
Why `OrderedDict`? Is there an advantage other than the semantic one in using it over `dict`? More
zip_longest does the job-Stensen 1 1
You can also use the `textwrap` core module here. `textwrap.wrap(a, 2)`, will, as the docs say > Wraps the single paragraph in text (a string) so every line is at most width characters long. Returns a list of output lines, without final newlines. ``` import textwrap def split_pairs(a): a += " More
First-Ordik 1
Instead of `'abcdefghijklmnopqrstuvwxyz'`, you could use the `string.ascii_lowercase` string. ```py >>> import string >>> string.ascii_lowercase 'abcdefghijklmnopqrstuvwxyz ``` More
Unix Match, part 1-ddavidse 1 1
Great logic. Only one thing - my linter's statement - Unnecessary "else" after "return". Also, what does `L` stand for? More
First-Tinus_Trotyl 1
Can someboyd explain why `lstrip` seems to return a list sometimes? More
OrderedDict-martin.pilka 1 1
Is there any reason to use `OrderedDict` over the normal `dict` class now, considering that `dict` is ordered now? More
First-Pouf 1 1
Could you explain what the 'NFD' means? More
Using list comprehension-WreakHavoc
You can use the `textwrap` core module here. `textwrap.wrap(a, 2)`, will, as the docs say > Wraps the single paragraph in text (a string) so every line is at most width characters long. Returns a list of output lines, without final newlines. ``` import textwrap def split_pairs(a): a += "_" if More
Beginning Zeros-Tavisevik
There is a string method called lstrip which strips the passed parameter from the left side of the string (or spaces if a parameter isn’t passed). So `number.lstrip(0)` will return the number without any zeros in its left side. You can use this and check the `len` of `number.lstrip(0)`, and subtract More
Beginning Zeros-bart.moura
There is a string method called lstrip which strips the passed parameter from the left side of the string (or spaces if a parameter isn’t passed). So `number.lstrip(0)` will return the number without any zeros in its left side. You can use this and check the `len` of `number.lstrip(0)`, and subtract More
Convert and Iterate-bryukh 1
Great solution. But I used `math.prod([int(char) for char in str(number) if char != '0'])`. Is there any disadvantages in that? More
First-monkshorin 1
You could just do `return sum(array[::2]) * array[-1] if array else 0`. Good solution though. More
First-liw_80
There is a string method called lstrip which strips the passed parameter from the left side of the string (or spaces if a parameter isn’t passed). So `number.lstrip(0)` will return the number without any zeros in its left side. You can use this and check the `len` of `number.lstrip(0)`, and subtract More
First-Moff
I used `re.split(r'\W*(\w[^,. !?"]*)', text)[1]`. What's the difference? More
just a gen-DimusLite 1
You can use the `textwrap` core module here. `textwrap.wrap(a, 2)`, will, as the docs say > Wraps the single paragraph in text (a string) so every line is at most width characters long. Returns a list of output lines, without final newlines. More
First-vlad.bezden 1
I used `len(set(elements)) == 1 or len(set(elements)) == 0` instead of `len(set(elements)) <= 1`. Great solution. More
First-renatadalbem
Instead of ```py if p_date[14:] == '01': v_m ='minute' else: v_m ='minutes' ``` You could do this: ```py v_m = 'minute' + ('s' if p_date[14:] != '01' else '') ``` Similar with the hour step ```py v_h = 'hour' + ('s' if p_date[11:13] != '01' else '') ``` More
1
2 3