23
Mladen H.
Last seen 5 months ago
Member for 9 years, 9 months, 4 days
Difficulty Normal
A very interesting solution. It would never come naturally to me to use 'None' as a parameter for list slicing, but when you think about it, it makes sense :)
More
An excellent idea using the cycle iterator.
One small tip for working with Enum: you can simplify the line 14 to:
self.state = cycle(list(Color))
More
Great solutions, I would say the third one is the most "algorithmic and fast", and probably the second "the most pythonic", while the first would be the most scholarly and clear :-)
More
A perfectly correct solution :)
Hint: Do you really need 'else' statement?
More
Interesting solution, I like how you showcased the use of the any operator.
ChatGPT
The word "any" in Python is used as a built-in function, not as an operator. The any() function is used to check if any element of an iterable (like a list, tuple, set, etc.) is True. It is commonly used with conditi
More
So, I see bins[1] is the same as nonunique and bins[0] as seen. How exactly did we get to that? I see people mentioning a tuple but then wouldn't it be bins = (seen, nonunique) ? And the double assignment, can we really do it like this, I've never yet seen it like that...
More
A very elegant solution where I learned that '' converts to False and every other string to True.
More
A very neat solution. Just a quick remark: Is there any point of iterating
over 'enumerate(histogram)' vs just 'histogram'?
More