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.
"entered_code" equal to zero is considered invalid. it's just not written directly in the condition
Neat! Never even thought about this
Clever!
Yeup good one!
You have a list of 2 numbers: [0, abs(res)].
If the (res<0) returns True then the second item is taken. That is because True is the same as 1 in Python and the item with index 1 is abs(res).
If the (res<0) return False then the first item is taken (False = 0 in Python). So the item with index 0 is 0 in that case
WTF
It doesn't make the code worse either
0
is not necessaryGood! But I do not understand how to apply such a notation of code "return [0, abs(res)][res<0]"