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-cierand
And now get rid of joined_string :) More
First-Pyromanser
Ok, and now get rid of unswer, as you don't need it. More
First-skninja
Hi, you can replace lines 5-10 with: return ','.join(list_phrases).replace('right', 'left') More
First-michal_krk 1
Hi, you do the same thing len(phrases) times, why? def left_join(phrases): output = ",".join(phrases) output = output.replace('right', 'left') return output # is enough. # And now get rid of output variable as you don't need it: return ",".join(phrases).re More
First-michal_krk 1
Hi, what's the point of the for loop? You do the same thing len(args) times. # this is enough: def checkio(*args): if not args: return 0 return max(args) - min(args) More
curse-casilda 1
Hi, ... good, evil... that's funny :) but line 10 isn't: return ",".join(curse) # is enough More
First-OleksiyKhomenko 1
Hi, () around the expression are redundant. More
First-amarshukla
Hi, there's some redundancy in your code: 1. You don't need to iterate over whole `data`. One `isSmall`, `isCaps`, `isLower` True, you don't need to continue. 2. You don't need to check each condition in every iteration. 3. `if...else` of lines 5 and 15 is redundant. def checkio(data): More
First-CaptCalculator
Hi, you could shorten it :) ~~~~ class Friends(): def __init__(self, connections): self.connections = list(connections) def add(self, connection): if connection not in self.connections: self.connections.append(connection) return True return F More
First-CaptCalculator
Hi, sum(word in text.lower() for word in words) could be more efficient. More
First-kenaniah
Hi, the only thing I would change: > `*` list/set/dictionary comprehensions More
First-CaptCalculator 1
Hi, one comment on this. You could write: return sum(a != b for a, b in zip(n, m)) instead of: count = sum([1 for a, b in zip(n, m) if a != b]) ​ return count More
lambda-Tarty 1
Hi, you don't need `[]` and the `..if..else...` in `sum`. More
First-sambdima97 1
Hi, why not? if abc not in text.lower(): return False More
First-goodmove
Hi, you don't need the data variable as you can return it directly: return [i for i in data if data.count(i) != 1] Tip: Feel free to remove the comments :) More
First-Japijapo
Hi, you can write: return sum(day.weekday() > 4 for day in daygenerator) More
First-Japijapo
Hi, 1. What is the point of allcaps variable names? (In fact you don't need any of these variables.) 2. _ad_ lines 6, 7: Look at _str.join()_. 3. Look at slices in python: return s[1:] # is enough. More
First-ilya.kudryashov.77
Hi, that `lambda` is redundant: return sorted(numbers_array,key=abs) More
First-Hojo
Hi, 1. look at _filter()_. 2. __str__ in Python is immutable so it is not a good choice for accumulating values. More
First-Japijapo
Hi, 1. i>= is already a bool so if...else is redundant: return i >= 1 # or even return i > 0 2. Once you've found a pair, it does not make sense to continue. So you can move the return inside the if and omit the _i_ variable: for every in words_set: if every.endswith(tuple(word More