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.
Nice C-style)
I thought I flagged it as spoiler.
It also shows me that this comment is marked as spoiler, don't know what went wrong here.
I just wanted to take the original solution here and keep the idea.
That's the reason why it still looks weird from a Python perspective :P
spoiler flag when you post solutions or critical info about them.
(btw, you solution almost looks like C code too. Just a bit shorter... ;) )
This comment is hidden because it contains spoiler information about the solution
But for the solution with is binary its perfect...
I agree, clever but probably not best practice.
I'm not quite sure how you class this as unreadable? What do you find confusing and/or unreadable about it?
Kinda creative way to solve this problem.
Just one recommendation here.
You have 3 return statements for your method ... try to reduce them.
It makes it easier to understand what and when it happens.
This return statement is just confusing.
I guess you did this on purpose, because it is an easy example, but things like this make code unreadable.
Although this is an easy example, there are some specialists out there, that do such things over and over again in similar cases.
I can't upvote this, because I don't think you should use string constants here.
It might be "Clever", but definitely not "Best Practice" imho.