29
lxf42
8 30 49
4299/ 4695
Last seen 3 months ago
Member for 2 years, 3 months, 6 days
Difficulty Normal
Best reviews / Newest reviews
First-c.aguirreserra 3
no need to call int, len returns an int More
11-liner: Pretty The Dream of eveyone-Stensen 2
Nice to see `with` used here on checkio not to to suppress exceptions More
Explained - Used Numpy-Selindian 2 1
The conversion to numpy array is not needed, you may pass data directly to the det function. More
First-Guest_5a80b5eb 1
I have seen some use for with, but no good use ... I used it for error suppression `with suppress(IndexError):` More
Partial-veky 1
good reason for me to look into partial and learn a new function :) More
Simple-mindaugas.dadurkevicius 1
The range function is more powerful, you may also use it to increase the value in bigger steps than 1. Or said otherwise, if you use range(0, len(items), size) you do not need to multiply by size inside the loop. In this case, if check is also not needed as the first element of the slice will always More
First-Kate3612 1
2 comments: - the else part is unnecessary as it does nothing, better not to include it - you should remove the print line when you are done with your coding (I suppose you added it for debugging). Leaving it means the function has a side effect that is not in the documentation. More
First-ostap.bender.ac 1 1
If you set X first and min afterwards, you're able to use X during the calculation of min. Be careful with your variables names, min does exist as function in python, but of course you are allowed to override in python. Might cause confusion later. More
1-liner: itertools.groupby-Stensen 1
didn't know about itertoosl.groupby, nice More
Create float intervals-V.Shkaberda 1 1
I think in the meantime int is allowed. More
Mutable Capital Function-PythonWithPI 1
In my opinion this is not a correct solution to the problem as stated. It passes the tests, but it does not create a class as requested. In some cases it behaves differently (Capital / c is the function, Capital2 the class, c2 is the object): >>> c = Capital('Kyiv') >>> c() Traceback (m More
Infinite function generator-Sim0000 1
nice idea to use a generator with two alternating yields! More
With regex-dbirmajer 1
so far I like this solution best More
First-Sim0000 1
The solution didn't age well, in the meantime we have the match-case statement in python 3.10 More
First-Keisuki 1
I don't like the use of global variables when the task it to implement a class More
If condition solve-sMiTeOne 1
There is however a small issue, python passes lists a reference to the original list. This means changes to the list inside the function will reflect to the calling code: >>> l = [5, 13, 27, 14] >>> l [5, 13, 27, 14] >>> checkio(l) 59 >>> l [59] While no problem for thi More
re (sub, fullmatch), translate/maketrans for exchange ',' and '.'-Phil15 1
Very nice, double re power, as well as short and very readable (well, as readable as regex can be) More
O'REILLY - "Chunk" (One-line version)-jsg-inet 1 1
Using the generator syntax instead of list comprehension would be speedier. More
First-ta5656tw 1
Personally, I find the c.lower() != c not very clear. Maybe you have seen the c.isupper() in other solutions. More
First-ta5656tw 1
Nice, my code was very similar, I used bool(re.match...) instead of the if/else. More
1
2 3 4 5 6 7 8