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.
It's because the
a if b else c
is a ternary operator, whils appendingif
to the end of the list comprehension will only include results which satisfy this condition in the list - in the latter case, having an else does not make sense.It does not. In fact, this is not even necessary - you can just do
for age, handicap in data
.The (x, y) syntax in these sort of loops will perform tuple unpacking.
This is same sort of syntax as:
a, b = [1, 2]
, or(a, b) = [1, 2]
.