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.
Thanks for your thoughts and ideas! The short answer is yes, it can be.
If you read the wiki article linked, you'll see a couple examples where you have more specific notation for variables with multiple subsets. For example,
arru8NumberList
is an array of unsigned 8-bit integers ("arru8"). The problem I found when trying to make more detailed implementation is that it either becomes very repetative, (e.g. one massive function with 50 if conditions) and the actual difficulty comes in writing tests for the function. I think ultimately, the actual fun and interesting part of the challenge is condensed into the code I've written.I've given it some more thought, and I think something that could be more fun would be setting up other conditions for the prefixes, and checking if the value inside of the variable meets the conditions for the given prefix.
That's a bad example for python, but the point is still the same. For a challenge like that, you'll still have to check the type() the way I was, but you'll have to actually use other logic to return True/False
Good contribution! However, you declared the parameter
food_source
as astring
and later pass aninterger
as a value in the tests. Perhaps you should declarefood_source
asAny
if you want it to be "any" type of datatype?