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-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
First-Victor.Mlnk
Hi, _min()_ and _max()_ are built-in functions. More
Counter-KateQuark
Hi, Rodnee is right. You shouldn't forget that 1. __list__ is iterable, therefore `''.join(letters)` on line is redundant. 2. There's a _filter()_ built-in function. 3. __Counter__ is a __dict__. Then: ~~~ from collections import Counter def checkio(text): all_counts = Counter(filter(str.isa More
First-KateQuark
Hi, 1. _list()_ is redundant, _sorted()_ works with any iterable. 2. There's a set intersection operator: `&`. More
First-KateQuark
Hi, 1. _list()_ is redundant. 2. You can omit the `if...else` using `and`. More
First-KateQuark
Hi, _lambda_ is redundant as _abs()_ is already a function: return sorted(numbers_array, key=abs) More
First-KateQuark
Hi, you can replace `elfis` with `ifs`. As you return in each branch you don't need `elif`. More
First-KateQuark
Hi, look at [extended slices](https://docs.python.org/3/whatsnew/2.3.html?highlight=extended%20slices#extended-slices) and slices with negative indices. More
I love Python-inga.s
> (My professor told us about it and we need to get to lv12 for a grade) That's funny. I've never head a course which would require to play on-line game to get the grade :) P. S.: Your comment is not [PEP8](https://www.python.org/dev/peps/pep-0008/) compliant. :) More
First-pandayue
Hi, look at _str.isupper()_, _str.islower()_ and _str.isdigit()_. More
First-naoto
Hi, you don't need `math.pow` there is the `**` operator. More
First-alex_es
Hi, docstring should be right after the function definition. Try this: >>> def my_function(): ... """This is my docstring.""" ... return x + y ... >>> help(my_function) More