March 3, 2024, 11:40 a.m. |
+ 3 |
for
try pop ellipsis-kdim
|
March 3, 2024, 11:33 a.m. |
+ 2 |
for
Straightforward-suic
|
March 3, 2024, 11:30 a.m. |
+ 2 |
for
Second: No intermediate list, just find it on the fly-ysenko
|
Sept. 5, 2022, 2:58 p.m. |
+ 2 |
for
First-kdim
|
Sept. 5, 2022, 2:40 p.m. |
+ 1 |
for
First-lxf42
|
March 11, 2022, 6:05 a.m. |
+ 1 |
for
ok, lets try this-Alexey.K.
|
Oct. 31, 2021, 2:16 a.m. |
+ 1 |
for
exclude zeros and then iterate multiplication-pakhomovegor
|
Oct. 30, 2021, 7:34 a.m. |
+ 1 |
for Comment
mombius: Oh, I did the same thing but used try-except to avoid the error when calling pop() in an empty stack...
|
Oct. 30, 2021, 7:20 a.m. |
+ 1 |
for Comment
jsg-inet: Nice, clean and compact!
|
Oct. 30, 2021, 7:20 a.m. |
+ 1 |
for Comment
jsg-inet: I like this solution: compact, and clean. You could put it in only one-line code. Just substitute "p...
|
Oct. 2, 2021, 4:42 a.m. |
+ 1 |
for
One line of code, but explaining what the line does-C.Fred
|
Oct. 2, 2021, 4:42 a.m. |
+ 3 |
for
First-bloodyrabbit
|
Oct. 2, 2021, 3:09 a.m. |
+ 3 |
for
title-yoichi
|
Sept. 18, 2021, 3:25 p.m. |
+ 1 |
for Comment
igharok: How about lstrip('_')
|
Sept. 16, 2021, 5:50 a.m. |
+ 1 |
for
First-9gress0r
|
Sept. 16, 2021, 5:48 a.m. |
+ 1 |
for
Simple replacing-sadra84
|
Sept. 5, 2021, 2:22 p.m. |
+ 1 |
for Comment
veky: Nothing anymore, they removed it in Py3. It was kinda locale-dependent lowercase alphabet, but reall...
|
Sept. 5, 2021, 2:20 p.m. |
+ 1 |
for Comment
veky: Lambdas can do many things defs can. In fact, as far as argument passing goes, everything except typ...
|
Sept. 4, 2021, 8:17 a.m. |
+ 2 |
for
itertools.cycle-Sim0000
|
Sept. 3, 2021, 10:49 a.m. |
+ 1 |
for Comment
dagger126: This can rewrite set(a) <= set(b)
|
Sept. 3, 2021, 10:39 a.m. |
+ 2 |
for
1-liner: prima aprilis -przemyslaw.daniel
|
Sept. 3, 2021, 8:23 a.m. |
+ 2 |
for
Second-gyahun_dash
|
Sept. 3, 2021, 8:19 a.m. |
+ 1 |
for Comment
arekrob: Yes, sorted() can be used with a set, but returns a list.
|
Sept. 2, 2021, 9:13 a.m. |
+ 1 |
for Comment
Cjkjvfnby: No need to **set(second.split(","))**, intersects accept any iterable
|
Sept. 2, 2021, 8:49 a.m. |
+ 1 |
for Comment
jsg-inet: Very nice one-line code! Great!
|
Sept. 2, 2021, 8:49 a.m. |
+ 1 |
for Comment
jsg-inet: I like both! Good Job!
|
Sept. 2, 2021, 8:47 a.m. |
+ 1 |
for Comment
jsg-inet: Very smart! Everyday learning something new!
|
Sept. 2, 2021, 8:28 a.m. |
+ 1 |
for Comment
kdim: right len(max(t, key=len))
|
Sept. 2, 2021, 8:21 a.m. |
+ 3 |
for
vek-StefanPochmann
|
Sept. 2, 2021, 8:11 a.m. |
+ 1 |
for
re.sub-gyahun_dash
|
Aug. 17, 2021, 10:20 p.m. |
+ 1 |
for
Check-Rotate-Check-bryukh
|
Aug. 17, 2021, 9:59 p.m. |
+ 1 |
for Comment
Cjkjvfnby: In that case generator comprehension is good choice, because map will need user defined function. I ...
|
Aug. 17, 2021, 9:56 p.m. |
+ 1 |
for Comment
Cjkjvfnby: Return **None, None** is good idea. **enumerate** has start argument. I don't sure that docstrings a...
|
Aug. 17, 2021, 1:11 a.m. |
+ 1 |
for
keiです、ども(`・ω・´)-s.keigo.11235813
|
Aug. 13, 2021, 6:56 p.m. |
+ 3 |
for
First-light2happy.718
|
Aug. 13, 2021, 6:39 p.m. |
+ 1 |
for Comment
shshlomy: very nice solution i will use: if x[int(i[0])] == x[int(i[1])] == x[int(i[2])]!="." instead
|
Aug. 13, 2021, 6:08 p.m. |
+ 1 |
for
First-vasiliykryuchkov
|
Aug. 13, 2021, 5:34 p.m. |
+ 2 |
for
11-liner: easiest by stack-przemyslaw.daniel
|
Aug. 13, 2021, 5:31 p.m. |
+ 1 |
for
First_Half-Sillte
|
Aug. 12, 2021, 7:34 p.m. |
+ 1 |
for
First-amandel
|
Aug. 12, 2021, 7:28 p.m. |
+ 2 |
for
Xs and Os: using set-danila.s_82f7885346184ca098f30
|
Aug. 2, 2021, 7:03 a.m. |
+ 2 |
for
First-flatline
|
Aug. 2, 2021, 6:45 a.m. |
+ 1 |
for Comment
jsg-inet: Thank you for your comments and for the suggestion about shorten the code. Sometimes I need to be ex...
|
Aug. 1, 2021, 8:18 a.m. |
+ 1 |
for
O'REILLY - "Multiple Lightbulbs"-jsg-inet
|
Aug. 1, 2021, 5:52 a.m. |
+ 1 |
for Comment
tarik.dsm: It not work properly with no sequential list like: [1, 2, 16, 43, 500, 502]
|
March 19, 2021, 10:20 p.m. |
+ 1 |
for Comment
mlahor: Classic straightforward solution. Good job!
|
Feb. 18, 2021, 7:42 a.m. |
+ 2 |
for
First-eugene100372
|
Feb. 18, 2021, 4:41 a.m. |
+ 1 |
for Comment
Ken_w: Educational:)
|
Feb. 17, 2021, 8:22 a.m. |
+ 1 |
for
Lightbulb Intro-anasstka
|
Feb. 17, 2021, 7:54 a.m. |
+ 1 |
for Comment
akomissarova: Because it's a constant https://www.python.org/dev/peps/pep-0008/#constants
|
Jan. 7, 2021, 10:45 a.m. |
+ 1 |
for
Median of Three-ddavidse
|
Jan. 7, 2021, 7:26 a.m. |
+ 1 |
for
First-CoffeeZzombie
|
Jan. 7, 2021, 7:25 a.m. |
+ 1 |
for
First-Tomasz_Wrobel
|
Jan. 7, 2021, 7:23 a.m. |
+ 1 |
for
First-YosoFat
|
Jan. 6, 2021, 6:57 a.m. |
+ 1 |
for Comment
DiZ: A recursive function that returns an int if it is or an accumulated flatten array: _sum_ function ad...
|
Jan. 6, 2021, 12:24 a.m. |
+ 1 |
for Comment
maybe: The wording "multi-pass" is not exactly in the Python "vocabulary", but I try to explain what I mean...
|
Jan. 5, 2021, 1:55 p.m. |
+ 2 |
for
One-liner-tom-tom_f993b3abc4814d4cb5476e
|
Jan. 5, 2021, 1:49 p.m. |
+ 1 |
for
from statics import median-Sim0000
|
Jan. 4, 2021, 2:15 p.m. |
+ 2 |
for
Compress List-JimmyCarlos
|
Jan. 4, 2021, 2:05 p.m. |
+ 2 |
for
First-twilyght
|
Jan. 3, 2021, 8:19 a.m. |
+ 1 |
for
(O_O)-sytchov1
|
Jan. 3, 2021, 8:17 a.m. |
+ 2 |
for
Simple groupby-r_tchaik
|
Jan. 3, 2021, 8:17 a.m. |
+ 2 |
for
GroupBy-kunkka71
|
Jan. 3, 2021, 6 a.m. |
+ 2 |
for
yield from reversed(ascending list)-Phil15
|
Jan. 1, 2021, 2:15 p.m. |
+ 1 |
for
First-Oleg_Babaev
|
Jan. 1, 2021, 2:15 p.m. |
+ 1 |
for
First-Aldir
|
Jan. 1, 2021, 2:13 p.m. |
+ 1 |
for
First-nutsrk
|
Jan. 1, 2021, 2 p.m. |
+ 2 |
for
First-PetrStar
|
Jan. 1, 2021, 1:16 p.m. |
+ 3 |
for
First-blaxmi
|
Jan. 1, 2021, 1:06 p.m. |
+ 2 |
for
re-tom-tom_f993b3abc4814d4cb5476e
|
Jan. 1, 2021, 1:03 p.m. |
+ 1 |
for Comment
tom-tom_f993b3abc4814d4cb5476e: Thank you for appreciation OK, we need to find all overlapping matches of the **word**: As **word** ...
|
Dec. 31, 2020, 3:35 p.m. |
+ 1 |
for
First-pokosasa
|
Dec. 31, 2020, 9:01 a.m. |
+ 2 |
for
0 <= first == second - 1-flpo
|
Dec. 30, 2020, 5:36 a.m. |
+ 1 |
for Comment
veky: There are two things to consider here: one, as I said, lambda is just one of the batteries. And it i...
|
Dec. 30, 2020, 4:17 a.m. |
+ 1 |
for Comment
veky: No, str is a class. >>> type('') is str True When x is an instance of a class X, then x.method(y,z) ...
|
Dec. 30, 2020, 4:11 a.m. |
+ 1 |
for Comment
ljy95135: I use a key=lambda x:abs(x) now I find I am quite wrong... Good answer!
|
Dec. 30, 2020, 4:10 a.m. |
+ 1 |
for Comment
bryukh: Sorry, only one in my head :-)
|
Dec. 29, 2020, 2:43 a.m. |
+ 2 |
for
find second, find first-zaqaek
|
Dec. 29, 2020, 2:43 a.m. |
+ 1 |
for
Index-JasonVoorhees666
|
Dec. 29, 2020, 2:36 a.m. |
+ 2 |
for
One line-lucas.stonedrake
|
Dec. 28, 2020, 3:54 p.m. |
+ 1 |
for
First-Oleg_S.
|
Dec. 28, 2020, 2:37 p.m. |
+ 1 |
for Comment
megabitik: The second solution is creative and funny! Nice job!
|
Dec. 16, 2020, 5:51 a.m. |
+ 2 |
for
(em)powering-ale1ster
|
Dec. 15, 2020, 10:11 a.m. |
+ 2 |
for
2-liner strftime the saver-Stensen
|
Dec. 15, 2020, 10:09 a.m. |
+ 1 |
for
Into the forehead-MrPod
|
Dec. 14, 2020, 1:44 p.m. |
+ 2 |
for
First-Aphirat_Nimanussonkul
|
Dec. 14, 2020, 1:13 p.m. |
+ 1 |
for
First-shaggyrobot
|
Dec. 14, 2020, 12:31 p.m. |
+ 1 |
for Comment
zaqaek: And my solution was: > return True if len(elements) == 0 else len(set(elements)) == 1 Brilliant!
|
Dec. 14, 2020, 11:49 a.m. |
+ 2 |
for
Fifth-tom-tom_f993b3abc4814d4cb5476e
|
Dec. 14, 2020, 5:16 a.m. |
+ 1 |
for Comment
Spiritusvini: The walrus operator is cool! But there is a bit shorter: return [[items.pop(0) for i in range((len(i...
|
Dec. 14, 2020, 5:14 a.m. |
+ 1 |
for Comment
oduvan: +5 for ":=" ))
|
Dec. 14, 2020, 3:21 a.m. |
+ 1 |
for
Train-veky
|
Dec. 14, 2020, 3:17 a.m. |
+ 1 |
for Comment
shiracamus: A little shorter: checkio=lambda x:"www" in "".join('dw'[w.isalpha()] for w in x.split())
|
Dec. 14, 2020, 3:16 a.m. |
+ 1 |
for
First-Tubis
|
Dec. 10, 2020, 1:20 a.m. |
+ 1 |
for Comment
veky: The point is, the analogy with `if` is the easiest when paired with `while`: if cond: while cond: do...
|
Dec. 10, 2020, 1:19 a.m. |
+ 1 |
for Comment
dfridman: I'm just learning and I usually come to the solutions to see how more experienced people do it. I of...
|
Dec. 10, 2020, 1:19 a.m. |
+ 1 |
for Comment
Peter.White: > 3. You can use else statements with for loops. They are executed when the for loop ends naturally ...
|
Dec. 9, 2020, 1:04 p.m. |
+ 1 |
for
Second-Wakko_Warner
|
Dec. 9, 2020, 1:02 p.m. |
+ 2 |
for
First-kcab98
|
Dec. 9, 2020, 6:28 a.m. |
+ 2 |
for
Shiny-MrPod
|