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.
I'm sorry. Of course.
Use spoiler flag next time, please.
This comment is hidden because it contains spoiler information about the solution
W
Thanks for the feedback! I agree that returning 0 for an invalid data type can be ambiguous, since it masks the difference between the actual value of 0 and the error. Indeed, it is better to explicitly signal the error so that the user understands that something went wrong.
Disagree. How would we tell then if the sum of our array was actually zero or if it was an error?
The better way to handle this is to raise an error, or rather in this case just let the error that already exists be raised
Since the print function returns None, it is more logical to return zero if the type is incorrect.