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.
@jci55
,My guess would be dumb luck? You've raised an interesting point. I just tried with the
sale_percentage
set to0
and I do get theZeroDivisionError
with my solution. But the katas solution code also has the same result.On the one hand, it seems odd to have
sale_percentage
ever be100%
since a "store" would just be giving something away for free. Google seems to think "sale" means "the exchange of a commodity for money; the action of selling something" or "a period during which a retailer sells goods at reduced prices". According to those definitions, it seems like an oxymoron to have a100%
sale.If a
99%
sale was agreed to be the highest percentage possible, only one number would need to be changed to ensure nobody else gets one (or more) random tests withsale_percentage == 100
.On the other hand, if
100%
is agreed to be a validsale_percentage
, at least one new hard-coded test should be added and the kata solution must be modified (since it also raises aZeroDivisionError
).Hopefully that helps to answer your question. Thanks for the comment!