5
Jérôme J.
http://www.olissea.com/
Last seen 2 years ago
Member for 11 years, 5 months, 28 days
Difficulty Normal
New improved version, faithful to this one this time:
http://www.checkio.org/mission/speechmodule/publications/JeromeJ/python-3/improved-version-faithful-to-my-original-one-line-poc-version/
More
Don't hesitate to also check out my better version of it (from my point of view at least): http://www.checkio.org/mission/implementation/python-3/17962/
More
Very repetitive!! :-S This is not the way Python should be used… Hardcoding is bad!
More
__My advises:__
- DRY (Don't Repeat Yourself),
- The name of your variables… You should give them better names.
→ __My personnal opinion:__ I'm not fan.
More
Instead of
len(re.compile(WHATEV).findall(data)) > 0
I think you could simply replace by:
re.search(WHATEV)
re.search will return None if the pattern is not matched and an object _ sre.SRE_Match otherwise.
None will be evaluated as False and any object, by default, will be evaluat
More
Aah, I didn't know max had a key argument just like sort and I also ignored about str.count, that's nice! Thank you! Beautiful, simple and clever.
More