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.
Damn, that's weird and genius actually
I wish I could mark this for bot, (Best practices as well as Cleverness), Codewars doesn't allow to mark both :sadpanda
(notification)
how did it work and what does it have to do with "key = str"
It's very obscure to figure out who exactly the "last" child is. I'm not convinced the kata expects correct results according to its own specification.
the supreme language.
You're welcome )
Thank you, that helps!
In python, conditional and Boolean expressions contain empty objects(0, None, ", [], {} ...) are treated as False, not empty(1, [1, 2] , {34, 45}, ' qwerty', print, int) as True. But it is important to remember that they are not equal! That is, 1 == True, but 1 is not True. For example: if 3+5: print('hi') here 3+5 is not an empty object that is perceived as True in the context of a conditional expression. But at the same time (3 + 5 ) != True.
Now about the main thing. Logical operations in python use so-called Lazy Evaluation. This means that in an expression for example: (False and True) values are calculated in order from left to right, but and gives True only if both(all) operands are True, that is, as soon as python gets False in an expression with AND, it knows that the truth will not work and immediately returns this value. An expression with OR gives True if at least one operand is True, that is, it will return the first one that comes along, but if it does not find it, it will return the last one.
Here I hope I pushed you on the right path and didn 't confuse you too much : D
Test is giving the error below;
"Your regex should NOT match";
'aaaa c c ce e eeefffff ll pppppp '
' ccc eeee hhhhhh llloo t vvvv v yyyy y '
' hhhh xx xxyyy'
And more like that. Last I checked those are in alphabetical order with an arbitrary number of spaces at any index in the string.
"a or b" <=> "a if a else b"
This comment is hidden because it contains spoiler information about the solution
Would fail for
cycle(1, [1,2,3], 3) == 1
Absolutely no need giving an array as input. Integer
n
would suffice.nice
Loading more items...