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.
Why you not check a != 0 and b != 0?
You clearly understood the fundamentals :)
if you recall the boolen expressions.
True and True automatically return True
True and False / False and True return False
Its smart
simple and clear!
number % a == 0 and number % b == 0 evaluates to True if both are True
number % a == 0 and number % b == 0 evaluates to False if either or both are False
So there is actually a boolean being returned :P
Hi Chrono,
That's very cool.
I didn't know that.
That will save a lot of time.
Thank you very much!
Josh
No, a logical expression already evaluates as a boolean and sometimes there is an implicit type casting depending the language.