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.
Fixed.
Changed
-1
to0
(with backward compatibility).Updated random tests (old tests never generate
0
/-1
).Oh, interesting usage of this Python stuff. Thanks for the explanation.
Here, [-1,1] is the array and this [g=="boy"] indicates the position of the array to be taken based on the condition. If the gender = "boy", then [-1, 1][1] would return 1 as the condition is true and if the gender = "girl", then [-1, 1][0] would return -1 as the condition is false. Basically, it is a [array][position] arrangement.
Like for this one, but what is [-1,1][g=="boy"]? How it is work and when you can use this?
Both work.
You must write == insted of 'is'.
break not brake, use None/0 instead of -1