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-sajnin
You can you x ** 0.5 instead of sqrt(x). More
First-Tarty
It's nice and short. I was surprised that even the last line is shorter than 80 characters. :) Good job! More
First-austin.huff
Hi, 1. Line 2 is redundant: __tuple__ is iterable. 2. Line 3 and 4 are redundant: `return ','.join(x).replace('right', 'left')` Regards, suic More
First-Sabina 1
Hi, 1. _issufix()_ is redundant see [_str.endswith()_](https://docs.python.org/3.5/library/stdtypes.html?highlight=str.endswith#str.endswith) 2. `is not` and `!=` don't do the same thing (look at [this](https://docs.python.org/3.5/library/stdtypes.html#comparisons)) 3. Instead of: if word1 is More
First-Sabina 1
Hi, 1. look at the _sum()_ builtin: sum(int(digit) for digit in xnorm) 2. In fact, you just need to count the number of "1" in xnorm, therefore: return bin(n^m).count('1') More
First-Sabina
Hi, 1. this is quite inefficient as __str__ is immutable. 2. Look at negative indices. For non-empty string/list/tuple... `seq[:len(seq)-1] = seq[-1]`. 3. Look at _str.join()_. More
First-Sabina 1
Hi, `numbers` are redundant. Why not `def checkio(portions):`? More
First-Sabina
Hi, 1. You could write: matchstring = ",".join(matchlist) # instead of: matchesstring = "" for match in matcheslist: matchesstring = matchesstring + match + "," matchesstring = matchesstring[:len(matchesstring)-1] 2. Look at __set__ built-in type and set operations: More
First-Sabina
Hi, you could use __set__ instead of __dict__ and `return len(alphabet) == 26`. More
First-Fedorovich
One thing: The last return "" and the print() statements are superfluous. More
Dirty, but fun-jtrip 1
Hi, to clarify my thumbs downs: First of all: What's creative in this? There's so much redundancy and unnecessary code. E. g.: 1. Print statements. 2. The last if: return fword == sword. 3. The fword and sword variable: return sorted(' '.join(first_word.upper()).split()) == sorted(' ' More
Digits Multiplication-EfGnevsheva
Hi, 1. __str__ is iterable => line 3 is redundant. 2. You could write `r *= i` instead of `r = i*r`. 3. `c` is redundant. You can use the list comprehension in for loop on line 6. 4. You could also solve it using _functools.reduce()_. More
Passchek using any()-lameei
Hi, the `if...else...` is redundant: return any(...) and any(...) and ... # is enough More
3 regex-val0u
Hi, those `bool()` aren't necessary. You could write: return bool(len(data) >= 10 and num.search(data) and upper.search(data) and lower.search(data)) # or even: return len(data) >= 10 and all(x.search(data) for x in (num, lower, upper)) More
"short" comprehension list -val0u
Hi, `range(0, x) == range(x)`. More
Using any!-Anas_Alzahrani
Hi, 1. All `== True` checks are redundant. 2. All `else` branches are redundant. 3. Finally: When you use _any()_ with `and` or _all()_ all the `if`s are redundant. Your code after step 2.: def checkio(data): if len(data) >= 10 : if any(c.islower() for c in data): if More
First-Rosetta93 1
Hi, `len` is redundant: if len(data): ... else: ... More
Difference-Seter 1
What about: def checkio(*args): if not args: return 0 return max(args) - min(args) More
First-Hayertjez
Hi, that `else` branch is redundant. This is enough: ~~~~ def verify_anagrams(first_word, second_word): first = first_word.replace(" ", "").lower() second = second_word.replace(" ", "").lower() for x in first: if first.count(x) != second.count(x): return False More
Terrible ?-Seter
A bit :) 1. Intstead of lines 7-9: `return "".join(result) == 'abcd...z'` 2. Look at [_sorted()_](https://docs.python.org/3/library/functions.html?highlight=sorted#sorted). It takes any iterable including __set__. Refactored: ~~~~ import re from string import ascii_lowercase def check_pangram(t More