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
List Comprehension Practice-jaburaschi 1
Hi, [] and ...if...else are redundant. You can write: return sum(w in text.lower() for w in words) More
First-Bogdymoto3
Hi, once result is True, you don't need to continue. In fact you don't need `result` at all: if eu >= 3: return True return False More
QuadVar PassCheck-20sahilg
Hi, 1.that last `if` and all the `== True` checks are redundant e. g.: return all((a, b, c, d)) 2. `data.split()` does nothing. 3. All `range (0, len(data) - 1)` are redundant: for x in data: ... etc. More
SecretMessage-vikaspace
Hi, ad my down votes: 1. What is this? Exercise in obfuscation? return "".join(filter(str.isupper, texte)) # that's all # but even a more basic way using for loop plus some accumulator list # would be much better. 2. Even if exceptions are cheap in python, that `try:...except...: bre More
First-Johnnie
Hi, 1. _letter.isupper()_ returns __bool__ so == 1 is redundant. 2. It would be much shorter with filter (in Py 2.7 even shorter than in Py 3.3): return filter(str.isupper, text) More
First-Johnnie
Hi, do not reinvent the wheel. Look at _str.join()_ method. More
First-hooy
I don't like that _regex_. What's wrong with _str.isupper()_? More
First-Ana_Pana
Hi, you certainly know, that [] are redundant :) More
First-Darbe
Why `return ('%s' % (r))`? r is __str__. More
First-Lumiera
Hi, 1. __str__ is a built-in type => don't use str as variable name. 2. That `print(str)` is unecessary. 3. `str.istitle()` is a __bool__ so `== True` is redundant. More
First-viktor.pecheniuk
Hi, `cap` and `message` are redundant: return ''.join(x for x in text if x.isupper()) # with filter() it would be nicer and shorter: return filter(str.isupper, text) More
First-ntuphysdavid
Hi, [] are redundant. Tip: Look at _filter()_ built-in. More
First-Johnnie
Hi, those nested `if`s are redundant. E. g.: elif operation == "implication": return x == 0 or x == 1 and y == 1 More
First-Gennady
Hi, you can write this instead of the last if: return index and triangls_num[index[0]:index[1]+1] More
First-KRThunder
Hi, why not?: if nt: s = [f(x) for x in range(nt,nt+a+1)] return s More
First-lsk45
Hi, why not?: elif cha in low: w4=True if w2 and w3 and w4: return True More
First-Froll
Hi, can you see three times the same pattern on lines 5-12? Look at _sorted()_. More
First-Froll
Hi, all the nested `if`s are redundant, e. g.: if operation == "equivalence": return x == y # or if operation == "conjunction": return x and y # etc. More
First-Froll
Hi, 1. Lines 5-6 do nothing. 2. What's the point of line 14? Why not: `return b`? More
First-Froll
Hi, man __8 from 9 lines are redundant__. 1. Remove _print()_ before publishing. 2. Line 6 is redundant. __str__ has _str.count()_ method. 3. You don't need `k` variable: return bin(number).count('1') # that's all More