12
wcass77
1 10 28
619/ 745
Willy Cass
Last seen 2 years ago
Member for 5 years, 8 months, 23 days
Difficulty Normal
Best reviews / Newest reviews
pop()-pavel.borisofff 1 1
Clever solution to the problem. A couple suggestions: I think it would be clearer if you used different names for the class and instance versions of the color variable. Even though they are in different name spaces, it can get confusing. Plus, if __init__ were to change so that the instance variable More
one_liner-MBM_1607 1
Good job doing it in one line. More
First-Sim0000 1
Very easy to understand code. Follows the recommended design pattern perfectly. More
Network Attack - Simulation-Michal_Szajer 1 1
Good job. I noticed a few things: 1) People don't usually predeclare their variables in python. In cases where you want to add to a list and start with an empty one, it is usually clearer to set up the empty list immediately before the list. 2) If you're going to use NumPy, why convert matrix to an More
all() - variant-Oleg_Domokeev 1
Clear even though it uses a nested list comprehension. Might consider formatting on multiple lines to keep less than 80 characters and increase clarity. More
First-ndj_ys 1 1
The for ... else syntax isn't really doing anything useful here. There is no break statement in the for loop, so the else block will always execute. Your scheme for storing fonts and text in the same variable is also fairly convoluted. I would take a look at the memento design pattern recommended in More
simple-lamesaatupuan 1 1
It's not clear to me why this answer works. Each lamp should have its own state, so that light_iter is specific to each Lamp instance. Here though, with the use of the global keyword it seems that it is not. In the test code below the solution, I would think that it would fail when confronted with t More
with collections.Counter-Phil15 1
Good use of generator expressions, itertools, and Counter! More
table-Sim0000 1
Great solution! I love that you use the dictionary to create a circular list. I can think of a problem I did recently where this pattern would really have helped. Great job! More
Multicolored Lamp - intelligent getter-bkai 1
Great, simple solution. A couple things you might consider: -You could make lights a class variable (define it inside the class but outside a method), as it is shared by all instances of the class. You can still refer to it as self.lights -You could consider changing the name of getState to _getStat More
Store states reversed-quarkov 1 1
Note that popping from a list and adding it to the front like this is very inefficient. The entire list needs to be rewritten in memory. In this case it’s a nonissue, but this can be a big slowdown if the list is big or if the method gets called many times. Also, it appears the state() method is not More
my best now-akaka 1
Good answer. Would recommend more descriptive variable names: start, end rather than s, e. More
First-yoichi
The way that you save the text as the text.show output and don't separately maintain the font would break in certain cases. For instance, if you saved the text with a font, restored the saved version, then added more text, the font would be in the middle of the text. More
matrix-anna_lvova
Simple, direct numpy solution. Technically should be in the 3rd party category More
First-David_Davi_Davies
Really like that you put the regrex split up in a comment with explanations. More
First-flpo
Your use of comprehensions makes the code very compact, but I'm having trouble understanding how some of it works. Particularly line 12. Do you mind explaining it? More
First-aviral983
Looks good. The first part is a bit confusing - it might be simpler to just check for a number in the for group (with .isdigit()). For the return statement, you could just return the condition directly. Also, I think 'and' is more appropriate than '&' in this case (but both work). See https://stacko More
First-mozurin
Concise, but no reason to assign a lambda. You can use def as a one line statement: def correct_sentence(t): return t[0].upper() + t[1:] + ('.' if t[-1] != '.' else '') More
First-aszychlinski
This is basically what I did. Looks good. More
First "The Ship Teams"-Sanja_Morik
Looks good. Could consider assigning both empty lists at once: first_command, second_command = [], [] More
1
2