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.
You can't explain.
I don't understand. Can someone explain why the extra parenthesis?
This comment is hidden because it contains spoiler information about the solution
explain
cheat fingerprint
...as mentioned already 3 times before...
this is not correct, since it is mutating the original list
what's with the extra parentheses?
True :-)
"""Do not mutate the original array/list."""
Aha! Thank you very much!
In python an empty string/list/set/tuple is considered falsy, similar to
False
,None
or0
(read more here: https://docs.python.org/2/library/stdtypes.html#truth-value-testing)So
if numbers:
means that if thenumbers
list is not empty, then...if x
is the same asif len(x) > 0
orif x > 0
orif x == True
etc.What is this trick of using only the variable name after the
if
?new_numbers = numbers[:]
Description updated.
Loading more items...