15
Eugene Nsk
Last seen 2 months ago
Member for 2 years, 11 months, 17 days
Difficulty Normal
> def heal(self, target):
> """Damage is reduced if given heal() but cannot be negative.
> Equivalently, health cannot exceed initial health value."""
>
I'm not sure that a Healer can't heal a warrior wounded in a previous round (where the previous opponent did hit harde
More
Nice. I would suggest using the integer division operation (//) to avoid floating-point operations on the indexes.
More
Great! :) Not re-inventing the wheel ^_^
Just literally: “Return the statistics’ median of the data.” :)
More
Great! But you could get rid of the `flag` variable:
just `return True` when `cnt >= 3`.
More
Great! The only thing I don't like is the `_dict` variable name.
According to [PEP 8](https://www.python.org/dev/peps/pep-0008/), a leading underscore is "for non-public methods and instance variables", but (as far as I inderstand) you use it "to avoid conflicts with Python keyword" `dict` -- for wh
More
Nice ^_^
It might work a little faster (and take less memory) if you don't cut the first character, but check the i-th character of the string instead.
But for short strings in the tests the difference is not so big, I think.
More
Great! To make it more "Clear, Readable, Documented and Educational" I would recommend adding comments about the features beginners don't know (the `(?=...)` thing).
More
It's great to use the built-in function, but ,IMO, the "text =''.join(text.split())" is not really necessary.
The ".isupper()" method works exactly the way described in the task.
More