March 21, 2023, 3:40 p.m. |
+ 1 |
for Comment
CDG.Axel: Construction like this produce a list that never used. In addition it allocate memory for it. prod([...
|
March 21, 2023, 12:55 p.m. |
+ 1 |
for Comment
CDG.Axel: For the first two weeks of python coding I became stuck for a minutes of 2-for iterables: matrix = [...
|
March 21, 2023, 12:41 p.m. |
+ 1 |
for Comment
CDG.Axel: Now you code looks better, but it's not the end. You need no 'cycle' variable now: els = [min(end_wa...
|
March 21, 2023, 12:38 p.m. |
+ 1 |
for Comment
CDG.Axel: Second, you can use zip() for iterate pairs. And throw away 'if len(els) % 2' condition as a bonus: ...
|
March 21, 2023, 12:38 p.m. |
+ 1 |
for Comment
CDG.Axel: So, try next tasks in the Lightbulb family :) I spent a lot of time optimizing it. Last task ([Light...
|
March 21, 2023, 12:33 p.m. |
+ 1 |
for Comment
CDG.Axel: I have got some code optimization experience more than ten years ago, mostly with assembler & c++. A...
|
March 21, 2023, 8:26 a.m. |
+ 1 |
for Comment
CDG.Axel: My first and last book about python was google search :) Books can be useful, but practice improve y...
|
March 21, 2023, 8:22 a.m. |
+ 1 |
for Comment
CDG.Axel: Great solution!
|
March 21, 2023, 8:21 a.m. |
+ 1 |
for Comment
CDG.Axel: Great solution! But you could try to improve it with 'zip' function.
|
March 20, 2023, 10:53 p.m. |
+ 1 |
for Comment
CDG.Axel: Wow, I have some ideas to improve your code! First, None values for start_watching and end_watching ...
|
March 20, 2023, 10:51 p.m. |
+ 1 |
for Comment
CDG.Axel: As for me, four strings for such task is too much :) p = text.find(symbol, text.find(symbol) + 1) re...
|
March 20, 2023, 10:45 p.m. |
+ 1 |
for Comment
dig: Line 5 for i in range(int(len(els)/2)): maybe better if use the // division, so it would be: for i i...
|
March 20, 2023, 10:43 p.m. |
+ 1 |
for Comment
dig: Very clever use of __pop__, giving it 2 functions: deleting from list and inserting to the beggining...
|
March 20, 2023, 10:42 p.m. |
+ 1 |
for Comment
dig: Very readable, it should be in clear category ;) One possible optimization suggestion would be to us...
|
March 20, 2023, 10:28 p.m. |
+ 1 |
for Comment
CDG.Axel: Looks like it was first steps with python :) I started my way there while tried to find some practic...
|
March 20, 2023, 10:24 p.m. |
+ 1 |
for Comment
CDG.Axel: Great using of itemgetter! By the way, there is the 'sorted()' function, and you can pack it all to ...
|
March 20, 2023, 10:19 p.m. |
+ 1 |
for Comment
CDG.Axel: PS: Your solution will not work for tests like this: is_all_upper('Aaaaa!!!'). It's not a problem be...
|
March 20, 2023, 10:16 p.m. |
+ 1 |
for Comment
CDG.Axel: Constructions like 'True if condition1 else condition2' looks strange, and may be replaced with 'con...
|
March 20, 2023, 10:13 p.m. |
+ 1 |
for Comment
CDG.Axel: There are some tricks to optimize solution: # original code return prod([int(i) for i in list(str(nu...
|
March 19, 2023, 2:26 p.m. |
+ 1 |
for Comment
veky: I learned long ago that you always disappoint _someone_ no matter what you do. :-)
|
March 19, 2023, 12:29 p.m. |
+ 1 |
for
Sorted set-r_tchaik
|
March 19, 2023, 12:29 p.m. |
+ 2 |
for
map can take more than 2 arguments-veky
|
March 19, 2023, 12:27 p.m. |
+ 2 |
for
1-liner: shorty-przemyslaw.daniel
|
March 19, 2023, 12:18 p.m. |
+ 1 |
for Task
Ascending List
|
March 19, 2023, 10:48 a.m. |
+ 1 |
for
Keep it simple-StefanPochmann
|
March 19, 2023, 10:45 a.m. |
+ 1 |
for
Encode and check-veky
|
March 19, 2023, 10:44 a.m. |
+ 2 |
for
First-petrushev
|
March 19, 2023, 10:34 a.m. |
+ 1 |
for Task
Striped Words
|
March 19, 2023, 10:33 a.m. |
+ 2 |
for
Toad-veky
|
March 19, 2023, 10:32 a.m. |
+ 2 |
for
A bit hacky-qria
|
March 19, 2023, 10:11 a.m. |
+ 1 |
for Comment
oduvan: I didn't expect that it is possible to be solved by RE only :)
|
March 19, 2023, 10:05 a.m. |
+ 4 |
for
Regexes all the way-ale1ster
|
March 17, 2023, 8:38 p.m. |
+ 1 |
for Comment
Phil15: From the end (**tail**) 5 4 3 2 1 5 4 3 ^ the last **common** thing is 3.
|
March 16, 2023, 4:06 p.m. |
+ 1 |
for Task
Convert and Aggregate
|
March 16, 2023, 3:19 p.m. |
+ 1 |
for Comment
blue_monkey: clear
|
March 15, 2023, 8:43 p.m. |
+ 1 |
for Task
Integer Palindrome
|
March 15, 2023, 8:41 p.m. |
+ 1 |
for Comment
CDG.Axel: Вы прям сподвигли меня запилить однострок для этой задачки (оставлял её на будущее)... Ну а вообще т...
|
March 15, 2023, 8:41 p.m. |
+ 3 |
for
One liner-CDG.Axel
|
March 15, 2023, 8:15 p.m. |
+ 1 |
for Comment
CDG.Axel: Я не сразу понял, что лучше не надо добивать зоны до конца.. Потом стал вообще оставлять простые зад...
|
March 15, 2023, 8:03 p.m. |
+ 1 |
for Comment
CDG.Axel: Я на эту тему даже не поленился задачку запилить - [Ugly Numbers from Codeship](https://py.checkio.o...
|
March 15, 2023, 7:57 p.m. |
+ 3 |
for
6 solutions, different speed (fastest with map)-CDG.Axel
|
March 15, 2023, 7:56 p.m. |
+ 1 |
for Comment
CDG.Axel: Можно сделать это в одну строчку с помощью dict comprehension: return {w, text.lower().split().count...
|
March 15, 2023, 7:55 p.m. |
+ 1 |
for Comment
CDG.Axel: О, тогда вам точно стоит знать, что можно еще использовать filter(None, iterable). Дико полезно быва...
|
March 15, 2023, 7:54 p.m. |
+ 1 |
for Comment
CDG.Axel: Это как раз очень хороший пример, чтобы показать, что строка является итерируемым объектом, поэтому ...
|
March 15, 2023, 7:47 p.m. |
+ 1 |
for Comment
CDG.Axel: Можно чуть пооптимизировать: return sum([int(i if i.isdigit() else 0) for i in text.split()]) --> re...
|
March 15, 2023, 7:40 p.m. |
+ 2 |
for
sum with for in one line-CDG.Axel
|
March 15, 2023, 7:38 p.m. |
+ 1 |
for Comment
CDG.Axel: Ууух, сложно и долго. count + in в одном флаконе:) И тут ооочень помогает суммирование bool: return ...
|
March 15, 2023, 7:36 p.m. |
+ 1 |
for Comment
CDG.Axel: Так выходит короче... Ведь max вполне может итерировать строку ) return int(max(str(value)))
|
March 15, 2023, 6:27 p.m. |
+ 1 |
for Comment
CDG.Axel: Кстати, слайсы реально офигенская штука... Многие долго программируют на питоне, но не знают, что их...
|
March 15, 2023, 6:24 p.m. |
+ 1 |
for Comment
CDG.Axel: Я почему-то очень не люблю принцип EAFP, и всегда стараюсь соблюдать LBYL (к тому же во многих языка...
|
March 15, 2023, 3:36 p.m. |
+ 1 |
for Comment
CDG.Axel: Ну, во первых быстрее, потому что нет индексации. А во вторых это всегда проще для понимания и короч...
|
March 15, 2023, 3:27 p.m. |
+ 1 |
for Comment
CDG.Axel: Кстати, быстрее становится потому, что len не делает перебора... Ну и судя по вашим цифрам, конкретн...
|
March 15, 2023, 3:24 p.m. |
+ 1 |
for Comment
CDG.Axel: Разумеется, на этом останавливаться не стоит. Я вот, например, считаю, что от range(len(x)) тоже мру...
|
March 15, 2023, 2:57 p.m. |
+ 1 |
for Comment
CDG.Axel: Можно чуть оптимизнуть код... sum([i for i in lst]) >> sum(i for i in lst) # sum может кушать любой ...
|
March 15, 2023, 2:40 p.m. |
+ 1 |
for Comment
CDG.Axel: Можно чуть заменить 1 if expression else 0 >> int(expression) К тому же с учетом того, что в качеств...
|
March 15, 2023, 2:18 p.m. |
+ 1 |
for Comment
juestr: That's to be expected, but it's not due to using lambdas, it's the horrific abuse of `Template`.
|
March 15, 2023, 1:52 p.m. |
+ 2 |
for
Four winds beneath my wings-veky
|
March 15, 2023, 1:52 p.m. |
+ 1 |
for Comment
veky: Yes, median is cool, people should use it more often. ;-) About `while ...:` try `...` and `bool(......
|
March 15, 2023, 1:44 p.m. |
+ 1 |
for Comment
CDG.Axel: Альтернатива тренировке регулярок: 1. yield from 2. извращенский способ проверки type(i) == int for ...
|
March 15, 2023, 1:27 p.m. |
+ 1 |
for Comment
CDG.Axel: Ну а вообще comprehension тут тоже не нужен, если подумать ) return ''.join(map(MORSE.get, code.spli...
|
March 15, 2023, 1:27 p.m. |
+ 1 |
for Comment
CDG.Axel: Для того, чтобы сократить задачу до короткой строчки достаточно сделать одну мелкую хитрость - добав...
|
March 15, 2023, 12:55 p.m. |
+ 1 |
for Comment
CDG.Axel: Ну и еще момент.. Так как у вас есть важное условие, что маркеры всегда присутствуют в строке, код м...
|
March 15, 2023, 12:55 p.m. |
+ 1 |
for Comment
CDG.Axel: Знание регулярок это конечно очень хорошо ) Но тут полно других задач, куда их можно засунуть с боль...
|
March 15, 2023, 12:30 p.m. |
+ 4 |
for
5 lines solutions-alterGNU
|
March 15, 2023, 12:24 p.m. |
+ 2 |
for
First-flatline
|
March 15, 2023, 12:19 p.m. |
+ 2 |
for
One liner (long line)-CDG.Axel
|
March 15, 2023, 11:57 a.m. |
+ 1 |
for Comment
CDG.Axel: Could you explain what it means? Looks like while True, but found no information where it's explaine...
|
March 15, 2023, 11:38 a.m. |
+ 4 |
for
methods contest-quarkov
|
March 14, 2023, 8:25 p.m. |
+ 1 |
for
Solution for 'First Word (simplified)'-emo_enchev
|
March 14, 2023, 8:18 p.m. |
+ 1 |
for
Template composition-juestr
|
March 14, 2023, 8:12 p.m. |
+ 1 |
for
First-Aagr
|
March 13, 2023, 11:03 p.m. |
+ 1 |
for Task
Words Order
|
March 12, 2023, 3:15 p.m. |
+ 1 |
for Task
Max Digit
|
March 12, 2023, 2:57 p.m. |
+ 1 |
for Task
Split Pairs
|
March 12, 2023, 12:49 p.m. |
+ 2 |
for
Concise algorithm-Igor_Sekretarev
|
March 12, 2023, 12:03 p.m. |
+ 1 |
for Task
All Upper I
|
March 12, 2023, 11:57 a.m. |
+ 2 |
for
echidna-Taichi26
|
March 11, 2023, 7:30 p.m. |
+ 1 |
for
Using groupby from itertools-WuYuFFFan
|
March 11, 2023, 7:29 p.m. |
+ 2 |
for
First-Adam.Michalak
|
March 11, 2023, 7:25 p.m. |
+ 2 |
for
eq(*)-flpo
|
March 11, 2023, 7:24 p.m. |
+ 2 |
for
First-Sim0000
|
March 11, 2023, 4:44 p.m. |
+ 2 |
for
one-liner-lezeroq
|
March 11, 2023, 4:41 p.m. |
+ 2 |
for
First-vlad.bezden
|
March 10, 2023, 9:39 p.m. |
+ 1 |
for Task
Simple Hashlib
|
March 10, 2023, 9:35 p.m. |
+ 3 |
for
digestive-veky
|
March 8, 2023, 10:39 p.m. |
+ 3 |
for
Partial-veky
|
March 8, 2023, 10:35 p.m. |
+ 2 |
for
vek-StefanPochmann
|
March 8, 2023, 10:34 p.m. |
+ 1 |
for Comment
drobotnik: Where do I go to understand what the hell is happening here? The Python docs for regex say that \w m...
|
March 8, 2023, 10:33 p.m. |
+ 1 |
for Comment
veky: > Where do I go to understand what the hell is happening here? You can always try asking me. Contrar...
|
March 8, 2023, 10:17 p.m. |
+ 1 |
for Task
Bird Language
|
March 8, 2023, 5:12 p.m. |
+ 1 |
for Comment
sesenion: Thanks, came easier to me than look up how exactly to use datetime again :)
|
March 8, 2023, 4:54 p.m. |
+ 3 |
for
First-DronovDen
|
March 8, 2023, 4:53 p.m. |
+ 2 |
for
First-antichrist_b
|
March 8, 2023, 4:51 p.m. |
+ 1 |
for
First-almos
|
March 8, 2023, 10:32 a.m. |
+ 1 |
for Task
Lightbulb Start Watching
|
March 8, 2023, 10:13 a.m. |
+ 2 |
for
creative slicing-juestr
|
March 8, 2023, 10:10 a.m. |
+ 1 |
for Task
Lightbulb Intro
|
March 8, 2023, 10:07 a.m. |
+ 2 |
for
First-suic
|
March 7, 2023, 11:31 p.m. |
+ 1 |
for Comment
dig: Does it work? Where do you check the remainder?
|
March 6, 2023, 11:11 p.m. |
+ 3 |
for
Gallery-veky
|