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.
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
?