40
suic
16 39 57
9966/ 10664
Last seen 1 day ago
Member for 9 years, 11 months, 3 days
Difficulty Advanced
Best reviews / Newest reviews
First-ZestyPickles
Hi, 1. `result` is redundant. You can return the `sorted(...)` directly. 2. `lambda` is redundant. `key=abs` is enough. Best, suic More
Easy to understand :)-AsEsm
Hi, 1. `round(float())`s are redundant. 2. You can handle the `len(args) == 0` case with `try..except` but there are more elegant ways. More
First-Sabina
Hi, you could use __set__ instead of __dict__ and `return len(alphabet) == 26`. More
Second-Sabina 1
Hi, you can unpack the date using `*`: date1object = date(*date1) More
First-Sabina
Hi, this is an anti-pattern: if len(leftbrackets) == 0: return True else: return False # as len(leftbrackets) == 0 is allready a bool return len(leftbrackets) == 0 # is enough # You can even write: return not leftbrackets 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, 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 use `stringnumber` only once, so you don't need it. 2. You could write `multtotal *= digit`. 3. `if digit:` is enough. 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 1
Hi, few comments: 1. _addup()_ is redundant. 2. You can write: if condition: return x else: return y # like this: return x if condition else y [Here](http://www.checkio.org/mission/restricted-sum/publications/suic/python-3/sabinas-shortened/)'s a shortened versi 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
MySolution_HousePassword-Grinny
Hi, I have a few comments: 1. That `if..else` and the `password` variable are redundant. Btw. line 3 doesn't make much sense. 2. Expression in parentheses can contain line breaks. It looks better than `\`. (see below) 3. Finally: You don't need `re`. Look at [string methods](https://docs.python.or More
First-Hayertjez 1 1
Hi, `number` is redundant: return int(str_number, radix) More
First Array slicing-Hayertjez 1 1
Hi, 1. You could write `array[::2]` 2. and also use _sum()_ instead of for loop: return array[-1] * sum(array[::2]) # That's it :) More
First-Benjamin.michelland
Hi, let me deduce from your code first: 1. You're comming from the C-world. 2. You speak French. I have a few pieces of advices: 1. Forget about semicolons in Python :) 2. Look at [_String Methods_](https://docs.python.org/3.5/library/stdtypes.html?highlight=str#string-methods). More
My first generator! I love generators!!! =D-ermichin158 1
Hi, good one. It's much more pythonic than your previous solutions. Two comments: 1. You should change the title a bit: "I love comprehensions!!!" :) Generators and comprehensions don't behave in the same way. (check this [blog post](http://python-history.blogspot.co.uk/2010/06/from-list-comprehens More
Pangram-HeyTech
Hi, `return len(foo) == 26` is enough. More
Ascii always help! =-ermichin158 1
Hi, writing Python code in C-style is not creative at all. More
A cool one =)-ermichin158 1 1
Hi, 1. What is creative in this? Checking if a character is uppercase using `ord(symbol) > 64 and ord(symbol) < 91` is quite obvious. 2. You could use _str.isupper()_ for this. 3. Concatenation strings in Python using `+=` is an anti-pattern. More