Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
This is a good solution, but s.lower() will get called for every ch in string.lowercase until all letters have been covered or ch is not in s.lower().
The square brackets are actually unnecessary here, without the square brackets you would have what's called a generator expression which works as an iterator on its own. The square brackets are only required when you need to use list functionality, for instance len().
Just thought I'd tell you because I also did this for quite some time before I learned that you can go without it.
krishp, 6 years ago
/
was integer division in Python 2.7.I know that this is 6 years late, but your submission is correct and passes all the test cases. The reason it was failing was because in line 7 you have prime_factors(n/i). Since for loops require integers, if you change this to prime_factors(n//i) it passes everything.
This comment is hidden because it contains spoiler information about the solution
Agreed. This kata could be improved by prohibiting use of str.endswith().
This comment is hidden because it contains spoiler information about the solution
Yeah!, You're right. I did't see that situtation. Well, the tests will be better..
This comment is hidden because it contains spoiler information about the solution
I think the 'in map' if/else conditional at the bottom of your move function will fail to catch the case where, e.g. you're at position 10 and try to move left. That should probably be checked for in the suite of submission tests, and perhaps I'm missing something obvious.
Description is too vague. The coder spends more time trying to guess what the author wants. A lot of information is missing or confusing. The discussion gives most of the details that still need to be fixed.
I thoroughly enjoyed this Kata, but it could definitely use some clarity improvements.
The Kata description should describe the Ball(object) and Ghost(object) classes, their attributes, and say that they are already implemented. I implemented my own Ball class and had started implementing my own Ghost class before I read the discussion and saw you had implemented them.
Mention and link to your other Kata regarding creation of the Ball class. Perhaps there's a Ghost class Kata as well (if not, I'd love to see you make it!).
As others have mentioned, inconsistent naming (and in particular the omission from the description of the Ghost.color attribute name) is a bit confusing for working up a solution.
This comment is hidden because it contains spoiler information about the solution
Hmm. Good point. Perhaps
ball_type
orballType
would have been better. :-/Ah, okay. That's more or less what I suspected, but I couldn't view the test cases prior to submission. Thanks!
Do you know if that test exceeds the max recursion depth of default Python 2.7, or if it just times out due to codewars' solution time limit?
Loading more items...