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-ZestyPickles
Hi, 1. `result` is redundant. You can return the `sorted(...)` directly. 2. `lambda` is redundant. `key=abs` is enough. Best, suic More
First-spoty 1
Why not _c.isalpha()_ instead of _c in ascii_lowercase()_? :) More
First-jose.coto
Hi, 1. `sum(array) * len(array)` is redundant you can `return 0`. 2. If `array` is not empty then `array[len(array)] == array[-1]`. More
lambda lambda lambda-njm2ody
It's a bit "overlamdized" :) A small tip: # Change b, c in a way you don't need to use not # and then you can write: return a(data) and b(data) and c(data) # what you could transform return all((a(data), b(data), c(data))) # and finally: return all(f(data) for More
One-liner generator-VirtualTam
Hi, a few things: 1. string is iterable therefore list() is redundant. 2. check str.isupper 3. in python you can write: 'A' <= letter <= 'Z' More
First-johnjohn
Hi, two things: 1. Why text[::], why not just text? 2. lambda is redundant: lambda x: x.isupper() # is the same as str.isupper # without ()! More
First-pedja
Hi, in this case: lambda l: l.isupper() # is the same as: unicode.isupper # without ()! More
Rock-rockneurotiko
Hi, you could omit the if in lambda: # 1. using filter() # 2. or use True == 0 and 0 * string = "": x * x.isupper() More
First-LMAO
Hi, you don't need the [] on line 10. More
Digits Multiplication -schanjr
Good one! P. S.: You can omit the >= 1 at the end. More
First-Slepice1
Hi, with all() you could make it a one-liner. More
First-WpoZoo 1
Hi, one comment: I would replace lines 13-15 with one line: # You can apply map(int, ) directly on splitted_data # and use it as argument of date year, month, day = map(int, splited_data[0].split('-')) # In fact you can eliminate these these three variables call_data More
itemgetter-gyahun_dash
Hi, interesting. I didn't know about itemgetter(). More
First-Amachua
Hi, I would write: def total_cost(calls, allowed=100): ... More
defaultdict-ciel
Hi, I didn't know about method caller. Thanks. More
AngelRaposo-AngelRaposo
Hi, comments are fine, but they make the code less readable. Splitting to paragraphs would make it more readable. E. g.: # To simplify the code, we use a defaultdict of lists that will contain # one entry per day containing all the minutes used by calls daily_calls = defaultdict(li More
First-dagger126 1
Hi, nice solution. There's one thing: As you don't use _time_ variable, you could write: data, _, seconds = i.split() More
First-panther-king 1
Hi, it's very easy to read ;) I have two little comments: 1. You don't use the _t_ variable, so you could write: d, _, s = call.split(' ') 2. But you could use it to reduce duplication: t = math.ceil(int(s) / 60) if d not in seconds: seconds[d] = t ... More
First-Victor.Mlnk
Hi, this a C-style solution. Try to look at _extended slices_ and _sum()_. More
Small shit-zymtom
Or a big one? :D 1. Look at _extended slices_: `array[::2]` 2. _sum()_ built-in function: `sum(array[::2])` 3. You could write `i += 2` More