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.
not true, at least for new python versions.
a or b
is evaluated to a if a is truthy and to b otherwise (doesnt matter the value of b).now, for ints that are not 0 this expression will always equal a, and b is never checked, since such numbers are truthy. this means, the kata code most likely indeed doesnt work as intended by authors
In fact cannot be smaller than 1, not 0. So should be "<= 0", due if in a test you pass a 0º angle it won't enter to the first condition but give you a result anyway, but an angle can't be 0, this is a line, right?
that's not really necessary, seeing how it was stated that only positive number would be given...
a or b returns the minimum of a,b you can try it out
You're right that this is wrong but
(a or b)
still can be< 0
because it'sa if a != 0 else b
.Um... no.
The construct
if (a or b) < 0
will never be True, because(a or b)
is parsed as a boolean clause((a != 0) or (b != 0))
which can only return False (0) or True (1), which can never be< 0
.You meant to write
if (a < 0) or (b < 0):
.