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.
Insufficient test cases make my solution that does not take into account a valid idle time for
hasJuice
passes easilyDescription is pretty bad at describing what the arguments of
hasJuice
even mean, e.gactiveUse
andneedFor
are separate.Needs random test cases.
This comment is hidden because it contains spoiler information about the solution
Like any resource that suggests using regex to parse HTML, this kata needs to be taken out behind the barn and shot. It is ill-concieved and badly implemented.
My solution is fairly inelegant, but it uses xml.etree.ElementTree - a pythonic and appropriate tool for parsing HTML.
In Python,
str
is a class andcls
is an OOP convention. The code can run fine with those argument names, butstr
(the string class) will be shadowed (therefore inaccessible) andcls
is not what convention would suggest (the class method equivalent ofself
).I think this would be more Pythonic:
This comment is hidden because it contains spoiler information about the solution