40
suic
16 39 57
9964/ 10664
Last seen 4 days ago
Member for 9 years, 10 months, 19 days
Difficulty Advanced
Best reviews / Newest reviews
First-AmaroVita 1
Hi, parentheses around ",".join(phrases) are redundant. More
First-HanleyWashington 1
Hi, in fact you don't need to import string here. Look at str.isdigit, str.islower and str.isupper methods. More
Fast-psystyle 1 1
Hi, you can write: return sum(word.lower() in text.lower() for word in words) More
First-hiya-m 1 1
Hi, 1. there's also 'str.isalnum()`. 2. I would move the len(data) < 10 to the beginning, once data is to short, you don't need to make the rest of the checks. 3. `bool` is redundant and it's not a good variable name as it's a name for a built-in type. More
Simple solution-psystyle 1 1
Hi, that if is redundant: return sorted(first_word.lower()) != sorted(second_word.lower()) More
First-psystyle 1 1
Hi, [] is redundant. _filter()_ built-in would be better here: return ''.join(filter(str.isupper, text)) More
The hard way.-CraigFranklin 1 1
Hi, this is "overparenthesized" :D # E. g.: bin_n = bin(n)[2::][::-1] bin_m = bin(m)[2::][::-1] + diff_len * "0" More
First-CraigFranklin 1
Hi, you don't need _alph_: for i in string.ascii_lowercase: ... More
First-CraigFranklin 1
Hi, parentheses around bin(number) are redundant. More
First-CraigFranklin 1
Hi, look at documentation for _sorted()_. Sorted has _key_ argument, which is quite useful. More
ABSsort-grifmang 1
Hi, lines 2-4 are redundant, just remove them. _numbers_array_ is iterable by itself so you don't have to convert it to list. The pattern in lines 2-4 you can usually replace with a list comprehension/generator expression (look at [this](https://docs.python.org/3/howto/functional.html#generator-exp More
First-lena-py 1
Hi, `letters` is redundant. len({char for char in text.lower() if char in string.ascii_letters}) == 26 More
First-mfurones 1
Hi, in python you don't need auxiliary variable to swap values of two variables. E. g. to swap the values of a and b it's enough to do this: a, b = b, a More
First-ZeratulAyuris 1 1
Hi, you could write: return sum(x in text.lower() for x in words) More
user friendly solution-kamitenshi 1 1
Hi, 1. Notice that you do many steps twice. 2. The last if is unnecessary: return liste1 == liste2 More
re-magdre 1
With \_\_import\_\_('re').sub() it would be a true one-liner. More
A lot of cycles...-ermichin158 1 1
Hi, `listToString` is reinventing the wheel. Look at [_str.join_](https://docs.python.org/3.5/library/stdtypes.html?highlight=str.join#str.join). More
beginner version-Rao 1 1
Hi, when you return the same thing from two branches you don't need two branches. More
First-laserpez 1 1
Hi, you could use str.isupper instead of t in ascii_uppercase. In that case you don't need to import ascii_uppercase. More
FirstComeSolution-KarKarbI4 1 1
What a stairway. :) Look at _any()_. More