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.
def init(self): is invisible and always exists while creating an object.
So if you don't add and args to it, you can pull it down.
false
,0
,""
,null
andundefined
all have the property that when used in a if statement that they will equate tofalse
. So it isn't necessary at all.As for production code, it is used without the
=== true
. Which is generally done for all if statements. We also don't write code likeThis comment is hidden because it contains spoiler information about the solution
Practially, it doesn't make any difference. The init method automatically returns none, so you don't need to include that instruction in your code. The 'pass' keyword does nothing, it is basically just a placeholder to keep Python from getting angry that you didn't include an indented block in the init method. If you used an empty return, or return None, you'd get the same results, you're just doing a little more work than you need to.
You can avoid all that reverse( )-ing if you use unshift( ) instead of push( )