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.
Duplicate issue.
You can try different approach.
Now there are 2 different major ways to do it from I saw in solutions.
nope
@BlindBasics https://docs.codewars.com/community/rules
"Rules
Be considerate. Codewars may have "war" in the name but it is actually a respectful and polite community. You will be interacting with users from across the globe, who have different personal opinions and come from different backgrounds and cultures. We are all here for the same thing, to learn and improve. The Codewars community has developers of all skill levels actively participating on the site and in discussions. If you are an experienced programmer, remember that others may not be. We are all learning, we just may be at different stages in that process."
They are.
Aren't tuples one of the most fundamental basics to learn about in Python??
Errrr.... seriously? :o
Personally I think using Python lists is ok for this. I think it will make the kata more approachable for students and Python beginners, which is my intended audiance with this kata.
Thanks for these comments. I have followed your suggestions and edited the kata.
I've looked at the Codewars documentation, and uploading images is not encouraged. However, I agree that an image would be useful, so I'll work on an ASCII art diagram.
A tuple is fine for this, a class would be really too heavy. Classes are suited when you have custom stuff provided like methods, or when you need mutable properties, not just a fixed number of ordered fields (at most,
namedtuples
, but it wouldn't bring much value; this structure is very uncommon on Codewars). If users want to use a class, let them do it on their own, but I am sure most wouldn't find any convenvience with it.The function must return a boolean, there is no reason to test if the value is truthy. Moreover the use of
test.expect
is discouraged ( https://docs.codewars.com/languages/python/codewars-test )Fixed.
Why???
This is not an issue, but at most a suggestion. IMO, not a bad idea, but this kata is almost 9 years old, has been solved thousands of times in Python, and doing those changes would invalidate all the submitted solutions. So it won't be done (one may agree with it or not, personnally, I don't really like it much BTW, but that's how it works here).
Loading more items...