April 18, 2024, 4:36 p.m. |
+ 1 |
for Comment
U.V: "abcdefghijklmnopqrstuvwxyz"+"abcdefghijklmnopqrstuvwxyz" contains in string package **from string i...
|
April 18, 2024, 4:35 p.m. |
+ 1 |
for Comment
walmas: ooh didn't know about these, nice..
|
March 30, 2024, 8:12 a.m. |
+ 1 |
for Comment
kdim: len(items) // 2 + 1 if len(items) % 2 != 0 else len(items) // 2 you can change to len(items) // 2 + ...
|
March 24, 2024, 3:25 p.m. |
+ 1 |
for Comment
kdim: Suitable place to use **yield** def find_divisors(n): for i in range(1, n): if n % i == 0: yield i
|
March 24, 2024, 3:23 p.m. |
+ 1 |
for Comment
kdim: Good use of RE. Why didn't you use ''.join()?
|
Jan. 16, 2024, 5:46 p.m. |
+ 1 |
for Comment
vtflnk: This is not a bad solution. Some people use sets. This is unreasonably difficult. So if you were to ...
|
Jan. 5, 2024, 5:07 p.m. |
+ 1 |
for Comment
tramcrazy: Exactly what I did! Well done, this seems to be the easiest way to do it with the Python default lib...
|
Nov. 16, 2023, 4:54 p.m. |
+ 1 |
for Comment
Kolia951: Agree with other comments! Very nice and pythonic solution.
|
Nov. 14, 2023, 6:35 p.m. |
+ 1 |
for Comment
mlahor: ChatGPT This provided solution uses regular expressions (regex) to find the length of the longest su...
|
Nov. 3, 2023, 6:03 p.m. |
+ 1 |
for Comment
tamagoyaki: "sympy" and "perfect_power"! incredible solution!
|
Nov. 3, 2023, 6:02 p.m. |
+ 1 |
for Comment
tamagoyaki: Great Speedy! I think using an assignment expression will speed things up a bit.
|
Nov. 3, 2023, 6:01 p.m. |
+ 1 |
for Comment
tamagoyaki: while len(ugly_list) < n*5: this "max count" is correct. Isn't the idea of using "pop(0)" instead ...
|
Nov. 3, 2023, 5:59 p.m. |
+ 1 |
for Comment
tamagoyaki: It's a fast and good solution
|
Nov. 3, 2023, 5:55 p.m. |
+ 1 |
for Comment
tamagoyaki: It's amazing how well you're using third-party solutions.
|
Nov. 3, 2023, 5:54 p.m. |
+ 1 |
for Comment
tamagoyaki: At first I thought this code would make a calculation mistake, but this code is correct.
|
Oct. 29, 2023, 7:36 p.m. |
+ 1 |
for Comment
kdim: "(op, *key), value in data" - cool! Your solution looks good!
|
Sept. 12, 2023, 4:03 p.m. |
+ 1 |
for Comment
Pavellver: Nice solution! Very good usage of string methods!
|
Sept. 6, 2023, 3 p.m. |
+ 1 |
for Comment
joe_5588: Interesting list comprehension, and I hadn't seen repeat before.
|
Aug. 29, 2023, 6:54 p.m. |
+ 1 |
for Comment
TheRing: Nice idea to use init functions with keyword arguments and default values.
|
Aug. 28, 2023, 5:05 p.m. |
+ 1 |
for Comment
kudinov.feodor: you ll have troubles if there are more than 1k stones
|
Aug. 24, 2023, 6:49 p.m. |
+ 1 |
for Comment
BootzenKatzen: Making this look easy! Short and to the point! I didn't know about istitle(), so thanks for that!
|
Aug. 17, 2023, 6:22 a.m. |
+ 1 |
for Comment
Pavellver: A great solution! Everything is clear, and, most importantly, the solution is short and clear!
|
Aug. 15, 2023, 4:10 p.m. |
+ 1 |
for Comment
TheRing: Not the most simple solution, but very readable.
|
Aug. 15, 2023, 12:27 p.m. |
+ 1 |
for Comment
kudinov.feodor: pattern = re.sub('\[\]', '[^.]', pattern) good catch, in my solution if I find [] I return False at ...
|
July 3, 2023, 5:04 p.m. |
+ 1 |
for Comment
flowerinapot: Nice solution with recursion, but it's probably more creative :)
|
May 31, 2023, 3:12 p.m. |
+ 1 |
for Comment
Oleg_Levonjuk: Very thoroughly documented. 8-) Nice!
|
May 22, 2023, 6:32 p.m. |
+ 1 |
for Comment
Pavellver: Good implementation of itertools and lamdas!
|
May 9, 2023, 4:06 p.m. |
+ 1 |
for Comment
LuckySmoke: Beautiful, I don't think there can be a shorter or clearer solution for this one
|
April 30, 2023, 8:57 p.m. |
+ 1 |
for Comment
Red_Ale: At that time, I didn't know regex module :P.
|
April 29, 2023, 10:34 a.m. |
+ 1 |
for Comment
kdim: Good work! Also you can use flag "re.IGNORECASE" import re def checkio(words): return bool(re.search...
|
April 5, 2023, 7:55 p.m. |
+ 1 |
for Comment
Red_Ale: I really like the using of RE module for this mission
|
March 15, 2023, 5:15 p.m. |
+ 1 |
for Comment
Kolia951: Nice solution! Why don't you inherit from Lancer() for example? Do not see the big reason to create ...
|
March 13, 2023, 4:51 p.m. |
+ 1 |
for Comment
kdim: You have a non-standard solution!
|
March 9, 2023, 7:20 p.m. |
+ 1 |
for Comment
dig: Very smart replace in order to be able of using striptime! Sadly I couldn't realize when I did my co...
|
Feb. 20, 2023, 4:30 p.m. |
+ 1 |
for Comment
hkgok1: Excellent and like the usage of replace
|
Feb. 2, 2023, 6 p.m. |
+ 1 |
for Comment
lisovsky: see how you can do without _eval_ using operators from the module _operator_: sum([op(int(bit * seco...
|
Feb. 1, 2023, 8:42 p.m. |
+ 1 |
for Comment
Kolia951: Nice solution! To remove `elif` I would propose the following regex: [a-z]\s?
|
Jan. 11, 2023, 3:36 p.m. |
+ 1 |
for Comment
Kolia951: At first, I thought that `[jan, dec]` is a some kind of a range of all days and was impressed by suc...
|
Jan. 6, 2023, 9:27 a.m. |
+ 1 |
for Comment
Kolia951: Good job! Numpy + itertools make this solution incredible =)
|
Dec. 20, 2022, 6:38 p.m. |
+ 1 |
for Comment
hbczmxy: Your solution is awesome! I like your solution! But I cannot understand your solution. I'm not quite...
|
Dec. 18, 2022, 6:29 p.m. |
+ 1 |
for Comment
lisovsky: You can also just write: sorted(values, key=abs)
|
Dec. 14, 2022, 9:18 p.m. |
+ 1 |
for Comment
Kolia951: I have used almost the same approach as you did, but you choosed a more difficult way to find a resu...
|
Nov. 29, 2022, 9:06 a.m. |
+ 1 |
for Comment
Kolia951: Nice solution without using collections.Counter()
|
Nov. 17, 2022, 6:48 p.m. |
+ 1 |
for Comment
vtflnk: Nice, but actually presence of "0b" does not affect the of 1.
|
Nov. 16, 2022, 6:20 p.m. |
+ 1 |
for Comment
jakubbortlik: I wrote a very similar solution, only I put the "replacing" function outside of the main function an...
|
Nov. 11, 2022, 7:50 p.m. |
+ 1 |
for Comment
jakubbortlik: You could collapse the first check `if line == [] or len(line) == 1:` to `if len(line) <= 1` and you...
|
Oct. 13, 2022, 4:18 p.m. |
+ 1 |
for Comment
patolucatis2: Replacing the first occurence with _ is something I hadn't thought, very imaginative.
|
Oct. 10, 2022, 4:26 p.m. |
+ 1 |
for Comment
Selindian: Nice. Readable with comments and not too long. I like it. Thank you for sharing your solution.
|
Oct. 8, 2022, 6:36 a.m. |
+ 1 |
for Comment
mu_py: nice introduction to generators 👌
|
Sept. 29, 2022, 4:54 p.m. |
+ 1 |
for Comment
mu_py: nice, straight-forward solution. another way to handle different values of item would be "match-case...
|
Sept. 14, 2022, 9:02 p.m. |
+ 1 |
for Comment
Wartem: Short yet clear. Can't get much better than this.
|
Aug. 27, 2022, 10:16 a.m. |
+ 1 |
for Comment
ozg: very good solution with re module. I like the regular expressions. I have two comments. First you ca...
|
Aug. 14, 2022, 6:44 a.m. |
+ 1 |
for Comment
ozg: I think str(chr(ord(item[0]) - 1))) is not easy to read.
|
Aug. 6, 2022, 1:32 p.m. |
+ 1 |
for Comment
Aleksandr_Komarov: Hi. I used the same approach. But your code is shorter and clearer.
|
July 12, 2022, 7:23 p.m. |
+ 1 |
for Comment
entreoutros: Interesting use of list to keep the sum instead of int, so you can save one line in the POP part ins...
|
July 7, 2022, 7:51 p.m. |
+ 1 |
for Comment
entreoutros: Good one! You actually don't even need to convert g to a list, as sum() works fine on it directly!
|
June 27, 2022, 5:55 p.m. |
+ 1 |
for Comment
Wojtek_Okularczyk: I think you don't need to sort while creating a dictionary.
|
June 21, 2022, 8:24 p.m. |
+ 1 |
for Comment
hbczmxy: Your solution is great! And it is very original, especially the use of regular expressions!
|
June 13, 2022, 5:14 a.m. |
+ 1 |
for Comment
Sergey_K: Using generator would reduce the code length, I suppose.
|
May 22, 2022, 5:48 p.m. |
+ 1 |
for Comment
pathFinder586: Correct and clear. I like that you even add an "Unknown figure!" for the rest conditions.
|
May 15, 2022, 5:10 p.m. |
+ 1 |
for Comment
russell.vinegar: Similar to my own solution but with a simple counter instead of building a list of real words (duh!)...
|
May 13, 2022, 3:44 p.m. |
+ 1 |
for Comment
heinrich.rhing: Instead of "if ...: if ...:" you may write "if ... and ...:" and an empty list is always False - so ...
|
May 10, 2022, 5:27 a.m. |
+ 1 |
for Comment
baldaevm: You can unite two if-conditions by using /or/ operator. It will shorten your code
|
May 10, 2022, 5:18 a.m. |
+ 1 |
for Comment
baldaevm: You can unite the first two if-statements, and return /line/, that will work for both conditions
|
May 6, 2022, 5:13 p.m. |
+ 1 |
for Comment
hbczmxy: 你的答案真是别出心裁!`list.insert`的使用恰到好处! Your answer is so ingenious! Clever use of `list.insert`!
|
April 26, 2022, 11:54 a.m. |
+ 1 |
for Comment
lxf42: nice, the solution has a small inconvenience, the object type is not __main__.Capital as some might ...
|
April 14, 2022, 4:42 p.m. |
+ 1 |
for Comment
lxf42: Two remarks: - instead of Counter you could use the standard set - for a very long line, your code w...
|
March 27, 2022, 1:04 p.m. |
+ 1 |
for Comment
Selindian: Nice. If you had used modulo, you could have left out the if. But i really like it this way. :-)
|
March 9, 2022, 4:51 p.m. |
+ 1 |
for Comment
Hemanth_Reddy: It was the best answer to give
|
March 7, 2022, 5:18 p.m. |
+ 1 |
for Comment
CDG.Axel: What is the reason of "import string"? It's very good case where EAFP >> LBYL.
|
Feb. 28, 2022, 5:02 p.m. |
+ 1 |
for Comment
seltata: Use txt.find('a') = -1 if 'a' not in txt or index('a') if in.
|
Feb. 20, 2022, 12:37 p.m. |
+ 1 |
for Comment
yizhexu: Creative for sure... I never thought about that way
|
Feb. 20, 2022, 7:02 a.m. |
+ 1 |
for Comment
Phil15: I kinda like it. It would be a bit ineficient to iterate over an entire book and list all indexes bu...
|
Jan. 29, 2022, 5:58 p.m. |
+ 1 |
for Comment
pathFinder586: I think the second if-block is redundant. Am I mistaken?
|
Dec. 28, 2021, 2 p.m. |
+ 1 |
for Comment
asjdhjshdajsd: Nice solution! But maybe you can express this in a shorter way? return t > f does the same as if t >...
|
Dec. 19, 2021, 7:09 a.m. |
+ 1 |
for Comment
iamchris: It could be shortened a little by using slicing instead of index, like that: sum([n for n in array[:...
|