15
JingMeng
3 10 22
957/ 1195
Jing Meng
Last seen 1 year ago
Member for 10 years, 8 days
Difficulty Normal
Best reviews / Newest reviews
probably not the shortest one....-z.thami 1
(FYI) By using the "ternary" operator in python (syntax: `exp1 if predicate else exp2`), the two if-then-set code blocks can be eliminated, e.g. ``` start_pos = 0 if begin not in text else (text.find(begin) + len(begin)) ``` which make the code more compact, and *sometimes clearer* while *somet More
Figure it out yourself.-veky 1
I suggest this solution would serve *better* if the story itself gets extended/generalized/complicated (either as another story/problem, or described/defined in comment/doc string) such that modeling the problem as a interpolation process would become *natural*, in which case those who are not famil More
First-wolfura991
By looking at the picture (the clock circled with 12-hour and 24-hour format numbers), the logic of deciding a.m./p.m. would become clearer. Apart from that, note that the (hours == 12 and minutes == '00') branch in your code can be merged with the last else branch as their code block are identica More
Operator, Not Sorted-jtokaz
Upvote for the [operator.lt, operator.gt] trick, the idea didn't come up to me :D Small advice: cache the fkey(temp_min) result cause the key function might be cpu/time-consuming. More
isalpha-Rudeboyz_Squad 1
Per the usage of all, u could replace with all(i.isalpha() for i in [words[i:i+3]]). More