July 2, 2023, 1:28 p.m. |
+ 1 |
for Comment
Mishytca: одно из самых красивых и коротких решений задачи. Функция checkio() получает на вход параметр num в ...
|
Feb. 8, 2023, 6:01 p.m. |
+ 1 |
for Comment
lisovsky: Nice solution! Nothing to add.
|
Jan. 14, 2022, 11:53 p.m. |
+ 1 |
for Comment
olevoniuk: Nice solution! Cool example of using Python "batteries". 8-)
|
Dec. 1, 2021, 6:31 p.m. |
+ 1 |
for Comment
CDG.Axel: you need no walrus and if-comprehension: return sum( max(0 ,(min(d2, end_watching or d2) - max(d1, s...
|
Feb. 27, 2021, 4:31 p.m. |
+ 1 |
for Comment
vvm70: In 15 line no need for [:2]. KvaNTy's code more simple.
|
Jan. 31, 2021, 8:08 p.m. |
+ 1 |
for Comment
SasuH: Took a few reads to understand. Clever solution.
|
Dec. 9, 2020, 4:10 p.m. |
+ 1 |
for Comment
MuxaJlbl4: Cool! I like this useage of groupby
|
Dec. 9, 2020, 4:10 p.m. |
+ 1 |
for Comment
Paul-Yuchao-Dong: I was thinking on the same lines, just don't want to construct some unreadable regex pattern. But yo...
|
Oct. 26, 2020, 1:26 p.m. |
+ 1 |
for Comment
t4d3uszk: There's no need to go through every day in a year. It is enough to check only the first and the last...
|
July 25, 2020, 3:53 p.m. |
+ 1 |
for Comment
joseke: I didn't know that you could define a function on a single line, I also didn tknow that you could us...
|
June 10, 2020, 5:02 p.m. |
+ 1 |
for Comment
r_tchaik: Very nice! Didn't know about this module.
|
April 6, 2020, 10:28 p.m. |
+ 1 |
for Comment
PHANTOM0308: Damn! Neat and concise. I was thinking the same way as you, but not as short as yours!
|
Jan. 30, 2020, 11:29 a.m. |
+ 1 |
for Comment
mailsiraj: You could have avoided the 2 calls to result.append like this: def remove_all_after(items: list, bor...
|
April 25, 2019, 10:49 a.m. |
+ 1 |
for Comment
BrianMcleod: I like `[*it]`. I used `list(it)`. I didn't know `[*it]` would do the same thing.
|
Jan. 24, 2019, 10:16 a.m. |
+ 1 |
for Comment
gileadslostson: Lambdas and descriptors? Oh my! ;) Very nice =)
|
Dec. 11, 2018, 9:19 p.m. |
+ 1 |
for Comment
Phil15: I did use yield from too but I prefered `yield from reversed(run)` to slicing making a copy. I quibb...
|
Sept. 3, 2018, 10:08 a.m. |
+ 1 |
for Comment
flpo: This is just to point out that the test cases are rather weak :-)
|
Aug. 27, 2018, 2:51 p.m. |
+ 1 |
for Comment
m_vv: your code made text.lower().split() on each iteration. You can make more optimal solution.
|
Aug. 27, 2018, 2:46 p.m. |
+ 1 |
for Comment
Villentre: Why not just "return first == second"?
|
Aug. 6, 2018, 4:29 p.m. |
+ 1 |
for Comment
von.Oak: Hi, nice idea with using `list` object class VoiceCommand(list): def __init__(self, channels): super...
|
July 29, 2018, 11:19 a.m. |
+ 1 |
for Comment
Gabbek: Very creative one. Nothing worse than a 4 years old code review, but hey! :D
|
July 21, 2018, 5:16 p.m. |
+ 1 |
for Comment
jbwb: Neat solution! Unfortunately, I couldn't get this algorithm to work with red words that have double ...
|
July 21, 2018, 10:55 a.m. |
+ 1 |
for Comment
Gabbek: I always like to look how DFS is written. Liking the use of defaultdict.
|
July 21, 2018, 10:50 a.m. |
+ 1 |
for Comment
Gabbek: Interesting one liner! Love to see new modules being used. Hope to talk to you a bit more in upcomin...
|
July 19, 2018, 8:59 a.m. |
+ 1 |
for Comment
veky: You're aware that you wrote the same thing three times? :-)
|
June 8, 2018, 8:02 p.m. |
+ 1 |
for Comment
Marcelo_Ozorio: Nice, avoiding if statement by using max(default = 0). Excellent.
|
May 30, 2018, 9:28 p.m. |
+ 1 |
for Comment
veky: Compared to [what](https://py.checkio.org/mission/bigger-price/publications/veky/python-3/connecting...
|
May 24, 2018, 12:08 p.m. |
+ 1 |
for Comment
lisfer: Hey! Greate job! I just have two comments: Actually, we instead of making clause like if : return Tr...
|
May 13, 2018, 3:46 p.m. |
+ 1 |
for Comment
crazychemistry474: Short but very efficient when the list went large.
|
May 1, 2018, 8:32 p.m. |
+ 1 |
for Comment
alexander.gorelyshev: ...I would invite you to take advantage of the beautiful Pythonic list slices: all you need to sum u...
|
April 24, 2018, 11:58 a.m. |
+ 1 |
for Comment
jtokaz: Good. Since "len(set(elements))>1" is a bool you can return it directly. You could return "not len(s...
|
April 17, 2018, 6:12 a.m. |
+ 1 |
for Comment
kurosawa4434: It's elegant solution :) I think that using 'str.maketrans()' is more readable. Line 13: for word in...
|
April 14, 2018, 6:42 p.m. |
+ 1 |
for Comment
jtokaz: Python has slicing similar to Matlab, e.g. array[::2]. Also in Python, any object can be tested for ...
|
April 2, 2018, 4:11 p.m. |
+ 1 |
for Comment
StefanPochmann: You [reinventor](https://github.com/python/cpython/blob/de7a2f04d6b9427d568fcb43b6f512f9b4c4bd84/Obj...
|
March 23, 2018, 2:06 p.m. |
+ 1 |
for Comment
narimiran: Not nearly enough cases.... See [here](https://py.checkio.org/mission/fizz-buzz/publications/jesaisp...
|
March 19, 2018, 3:25 p.m. |
+ 1 |
for Comment
veky: "<=1" was too much to ask? :-P
|
March 5, 2018, 9:58 a.m. |
+ 1 |
for Comment
veky: Why not simply "return l == list"? Lists are equal, not only their lengths.
|
Feb. 27, 2018, 6:41 p.m. |
+ 1 |
for Comment
Tinus_Trotyl: Whow . . . NICE . . . ! ! ! You did what I looking for (connecting an logical output value to add/di...
|
Feb. 27, 2018, 4:51 p.m. |
+ 1 |
for Comment
macfreek: Why reinvent the wheel? https://docs.python.org/3/library/difflib.html#difflib.SequenceMatcher.find_...
|
Jan. 1, 2018, 9:06 a.m. |
+ 1 |
for Comment
DahliaSR: Nice. Using _itertools.isslice()_, instead of slice notation, would also decrease the auxiliary spac...
|
Nov. 18, 2017, 2:33 p.m. |
+ 1 |
for Comment
flpo: Hi, I know that this is a creative solution but the positional argument inside the string are simply...
|
Nov. 15, 2017, 5:10 p.m. |
+ 1 |
for Comment
veky: Next time someone tells me Python is a functional programming language, I'll show them this. :-DD
|
Nov. 13, 2017, 12:06 a.m. |
+ 1 |
for Comment
przemyslaw.daniel: This one is ok and deserves to be in clear category. It could be made a little bit shorter by using ...
|
Oct. 14, 2017, 4:42 p.m. |
+ 1 |
for Comment
przemyslaw.daniel: +1 for perfect obfuscation of such a simple task :-)
|
Sept. 27, 2017, 7:54 a.m. |
+ 1 |
for Comment
hrvoje: Very cool use of string.join('()'). It does remind of a female body part, though. Naughty Veky. :)))
|
June 24, 2017, 8:47 a.m. |
+ 1 |
for Comment
PythonWithPI: I tried to do this, but it wasn't working. Good solution!
|
May 23, 2017, 8:21 a.m. |
+ 1 |
for Comment
veky: Of course. You would get more thumbs if you imported from stdlib. ;-]
|
May 8, 2017, 5:09 p.m. |
+ 1 |
for Comment
veky: Since so many people here adore your solution, I won't spend too much words about how beautiful it i...
|
May 3, 2017, 7:49 a.m. |
+ 1 |
for Comment
narimiran: Instead of defining the lambda function for a key, there's a simpler solution that serves the same p...
|
May 3, 2017, 7:48 a.m. |
+ 1 |
for Comment
narimiran: There are several things that can be learnt/improved here: 1. I already mentioned in one other your ...
|
April 19, 2017, 11:35 p.m. |
+ 1 |
for Comment
DahliaSR: Clear! You can improve your solution by apllying the [EAFP coding style](https://docs.python.org/3/g...
|
April 16, 2017, 11:28 p.m. |
+ 1 |
for Comment
DahliaSR: Very complicated and lots of redundant expressions. - Line 12: a = n What for? You are not reusing t...
|
Feb. 28, 2017, 8:57 a.m. |
+ 1 |
for Comment
kot0begemot: Wow, you just reinvented a bicycle! :) There is a built-in int() in Python that can use radix as a s...
|
Jan. 24, 2017, 11:15 a.m. |
+ 1 |
for Comment
oduvan: :) now we should have "3rd party Creative" category
|
Jan. 8, 2017, 9:49 p.m. |
+ 1 |
for Comment
DahliaSR: Wow, this one is scary! + the readability of this is bad while True: if flist[len(flist)-1] > 5000: ...
|
Dec. 29, 2016, 11:03 a.m. |
+ 1 |
for Comment
veky: I think this is the Perliest Python I've ever written. :-D
|
Dec. 27, 2016, 6:29 p.m. |
+ 1 |
for Comment
veky: Much clearer: define min_max with its true signature (reverse:bool, *args, key=None) and say min = f...
|
Sept. 9, 2016, 1:57 p.m. |
+ 1 |
for Comment
han97: Better use join method of strings to concatenate strings
|
Aug. 21, 2016, 9:20 p.m. |
+ 1 |
for Comment
han97: Use getattr built-in function. For example: getattr(hashlib, "md5") -> hashlib.md5
|
May 30, 2016, 3:10 p.m. |
+ 1 |
for Comment
veky: In fact, only the first and last [day](https://checkio.org/mission/the-most-frequent-weekdays/public...
|
April 30, 2016, 1:15 p.m. |
+ 1 |
for Comment
Ceph3: I don't get the strip. If I omit it I get the same results on the included messages: from string imp...
|
April 5, 2016, 1:59 p.m. |
+ 1 |
for Comment
spoty: I tried to use enumerate, but it didn't work. Because of that, I found this from Raymond, I think it...
|
April 2, 2016, 11:41 p.m. |
+ 1 |
for Comment
Cjkjvfnby: PEP8: For sequences, (strings, lists, tuples), use the fact that empty sequences are false. Yes: if ...
|
March 30, 2016, 7:53 p.m. |
+ 1 |
for Comment
Cjkjvfnby: Some notes about style: no need parenthesis and you miss space after coma return ",".join(phrases).r...
|
March 30, 2016, 3:52 p.m. |
+ 1 |
for Comment
minto: I think I need to comment a bit on this solution. This is a typical example of bad production code: ...
|
March 26, 2016, 11 p.m. |
+ 1 |
for Comment
siebenschlaefer: - You could replace the magic number ``4`` with ``calendar.FRIDAY``. - Instead of constructing a lis...
|
March 24, 2016, 8:50 p.m. |
+ 1 |
for Comment
veky: 1. Functions h and v are too similar to warrant such duplication of code, don't you think? Just call...
|
March 14, 2016, 7:52 a.m. |
+ 1 |
for Comment
veky: w(y,1+i,13)==4 for i in range(12) same number of characters, but easier to read IMO. Of course, the ...
|
March 7, 2016, 4:10 p.m. |
+ 1 |
for Comment
veky: len([x for whatever if cond]) ~~~> sum(cond for whatever) Faster, shorter, less memory-intensive and...
|
Nov. 4, 2015, 1:44 p.m. |
+ 1 |
for Comment
veky: ''.join and generator expressions would be much nicer solution instead of that C-like loop. (Not dir...
|
Nov. 2, 2015, 5:43 p.m. |
+ 1 |
for Comment
Alexona: if language == 'polski': return 'Kocham Pythona!' Hmm, it sounds kind of weird in my language.. :P
|
Sept. 10, 2015, 9:29 p.m. |
+ 1 |
for Comment
veky: Line 2 is unnecessary. You can have for x in text without problems. list is not the only iterable. A...
|
Sept. 4, 2015, 3:42 p.m. |
+ 1 |
for Comment
PyPoet: I remembered that this problem had a very simple solution presented in the official python tutorial:...
|
Sept. 4, 2015, 1:11 p.m. |
+ 1 |
for Comment
veky: Python keywords are not functions. Drop a lot of these parentheses. Also, why start in line 5? :-) A...
|
Aug. 27, 2015, 4:53 p.m. |
+ 1 |
for Comment
veky: Nice idea, but please watch the video "stop writing classes". ;-]
|
Aug. 27, 2015, 4:52 p.m. |
+ 1 |
for Comment
ArchTauruS: real love needs no reason, hehe
|
Aug. 27, 2015, 4:51 p.m. |
+ 1 |
for Comment
abe.dillon: You know the pythonic way would be to use a dictionary look-up right? ;-P
|
Aug. 27, 2015, 4:48 p.m. |
+ 1 |
for Comment
Ch0bits: OMG! I share your pain bro! PHP really sucks :)
|
Aug. 13, 2015, 8:18 p.m. |
+ 1 |
for Comment
Waanie_5ba01babafae48b3adbf8c0: This code is not very readable, and it seems really over-engineered.
|
July 21, 2015, 10:38 a.m. |
+ 1 |
for Comment
AQiccl135: +1 for kissing the snake -1 for not putting the comment on multiple lines.
|
June 30, 2015, 3:26 p.m. |
+ 1 |
for Comment
adviser: better use elif, because it will avoid unnecessary check. def checkio(number): if number % 15 == 0: ...
|
June 15, 2015, 7:28 p.m. |
+ 1 |
for Comment
gflegar: __+1__ for using list comprehensions and built-in functions. There is room for improvement though: 1...
|
May 27, 2015, 1:12 p.m. |
+ 1 |
for Comment
sidddhan: Why are you using magic numbers? The isalpha, islower and isupper built-in functions achieve the sam...
|
May 26, 2015, 5:17 p.m. |
+ 1 |
for Comment
veky: LOL. Do you have any idea how slow this is? Not to mention maintainability. :-D
|
May 25, 2015, 4:55 p.m. |
+ 1 |
for Comment
veky: Speedy?? Calling len, range, indexing all the way, modulo, comparing, accessing elements by those in...
|
May 25, 2015, 4:54 p.m. |
+ 1 |
for Comment
veky: Quick, easy and wrong. Please don't use empty except. Many more things can go wrong than you think. ...
|
April 20, 2015, 4:11 p.m. |
+ 1 |
for Comment
plane: max = int(len(data)/2) could be shortened to max = len(data) // 2
|
April 18, 2015, 10:12 p.m. |
+ 1 |
for Comment
Peter.White: Not very speedy. You are iterating over the whole text, which by definition must be at least as long...
|
April 13, 2015, 2:31 p.m. |
+ 1 |
for Comment
stalk: Hard to understand complicated one-line solutions
|
April 13, 2015, 2:02 p.m. |
+ 1 |
for Comment
honza.huspeka: No need for 2 lines: return [x for x in data if data.count(x) > 1]
|
April 13, 2015, 2 p.m. |
+ 1 |
for Comment
TkdevelLinkd: data_freqdict is same as Counter from collections module. You can use from collections import Counte...
|
April 13, 2015, 1:59 p.m. |
+ 1 |
for Comment
dada78641: Could be simplified a bit by removing extraneous variable definitions, e.g. data = nonUniqueData; re...
|
April 10, 2015, 1:57 p.m. |
+ 1 |
for Comment
veky: > Python is cool :) You have no idea. :-D First, you don't have to write your uppercase. Just from s...
|
April 10, 2015, 1:57 p.m. |
+ 1 |
for Comment
nickie: Very nice. Notice that you don't need the square brackets; `join` can take a generator as an argumen...
|
April 10, 2015, 1:53 p.m. |
+ 1 |
for Comment
veky: Why are you using CheckiO as your version control system? It's not supposed to work like that. If yo...
|
April 3, 2015, 7:21 p.m. |
+ 1 |
for Comment
EvanRavenelle: It's impressive but I think overly complicated and defeats the purpose of using Python (readability)...
|
April 3, 2015, 2:16 p.m. |
+ 1 |
for Comment
drobotnik: Hi, Why not just return sample?
|
April 2, 2015, 9:48 a.m. |
+ 1 |
for Comment
veky: When you use something as a name, try finding if there is already a builtin. Specifically, max with ...
|
March 31, 2015, 5:18 p.m. |
+ 1 |
for Comment
chros: instead of comparing with ord() you could have just checked each letter with letter.isidigit(), lett...
|
March 31, 2015, 10:06 a.m. |
+ 1 |
for Comment
Qandak: Hah, very funny:) I just reinvented a wheel!:) I didn't even think that int() has such a good batter...
|