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.
Obviously, it would be better to convert numbers to strings once only.
This will work in the mentionned case since, in Python, "0" != 0.
Note that this solution will transform 0.0s into 0s, but in Python this shouldn't be a problem.
Exactly!
Read about python's boolean operations here.
In a list comprehension an
if
can be added which will cause only those elements which satisfy the if condition to be added to the list.