24
Ulukai85
8 24 39
3198/ 3445
Last seen 1 month ago
Member for 6 years, 2 months, 3 days
Difficulty Normal
Best reviews / Newest reviews
translate to re-juestr 2 1
Interesting solution, just using error handling. Perhaps you could replace (hehe) line 8 with "return bool(re.fullmatch(p, filename))" to get rid of the double negation? More
First-Hajanek 1 1
In contrast to popular opinion (well, as it seems to me...) I prefer your nicely commented and readable approach to a convoluted one-liner. Good work! More
simple recursive-juestr 1
Ah, every time I see a solution with yield, I think: Great, I have to use that, too... but I never seem to make it ;) . I like your solution! More
First-l.szyman10 1 2
Clear solution, great! The for-loop with the else and if seems a bit convoluted, though. I wonder, if you could save one indentation there with an elif, but it is still reasonably readable, so hardly worth the effort. More
lines generator-Phil15 1
Very nice solution, I had no idea of that use for 'from' with yield. I also really like your commentary at the end, which really helps to understand it. I had to scratch my head a bit to understand the last return statement, with the 'next', but I think now I got it ;). More
First-oduvan 1
Very explicit solution, easy to understand! I have one question though: You don't initialize your subclasses and just give them the variables 'food_name' and 'drink_name' (without 'self'). Then in the parentclass you use 'self.food_name' etc. Why does this work, why don't you have to __init__ it? Th More
all()-ElisaZeneli 1 1
Good use of the all()-build-in. You can leave out the square brackets for the list-comprehension though. all() does not need them! More
Use lru_cache(), Luke!-obone 1 1
Wow, thanks for making me aware of LRU cache, cool solution. That seems to fit nicely here. One question though: You seem to rely heavily on strings. Wouldn't it be faster to use sets (or dicts) for this? More
First-PythonLearner
Very elegant, I think, how you use the dict for this. I just used str.replace() twice, but your solution seems to be more versatile! More
class Treasure:-flpo 1
Very interesting to use a class for this, I have to try that for these tasks, too, because I use them not too often, sadly ;) . Can you explain, what you did in the Treasures __init__ with the vars(self) ? I don't quite get it. Thanks! More
collections.Counter-Leonix
And here I am deploying a simple if/else conditional... ;) . Good work! More
First-thisislmmail
That is a working solution, but perhaps you could lookup the string methods replace and capitalize. Python makes it easy for you :) . More
Dataclasses + super()-swagg010164
Nice work, that is really interesting. I have to look into dataclasses. One (possibly dumb) question: Doesn't the army class need an __init__? I mean, there are Army instances that have to be initialized? Thanks! More
another convoluted one-furtadobb
Very clear, good job. You could save you some work/lines, when you write a parent class for the fighter types, I think. More
First-Oksana_Antropova
Straightforward and clear solution. Question to the 'else'-branch: Couldn't you make it an 'elif' to get rid of the nested 'if'? Should make it clearer! More
brute force-twilyght
That is a really neat solution, as far as I can tell. I like your use of namedtuple and getattr here, that's really inspiring. I hope to remember this ;) . One question though: I didn't reproduce it completely and it seems to work, but does the code really make sure that there is only the one correc More
Xs and Os Refetree-dtBane
Clear solution, good work! For this task a if-conditional is reasonable, but for greater grids it would be difficult ;) . Another thing: Shorter lines, i.e. a timely linebreak would make for far more readable code. More
Time Converter (24h to 12h)-bart.moura
Very nice! I really have to get into datetime a bit more. I didn't know that you could do that nice trick with the leading zero there! More
Second-grischenko.n 1
Very interesting! Great explanation and nice use of the dictionary. Makes me wonder, did you actually compare the running time to a more standard solution with a couple regex searches? Everybody, it seems, tries to do these things with perhaps not so optimal one-liners, when such a "ugly" (you wrote More
First-zafazowany.czarami
Good solution with datetime. In cases like this I try to solve it without datetime and just manipulate the string, because I always have a hard time getting into the whole datetime terminology ;) . In the long run your approach pays off, I think, so good work! More
1
2 3