pasokan at talentsprint.com
Mon Nov 7 04:02:33 CET 2011
IMO the regex is not too bad; I will not use it for this job -- typing
a 50+ character string
is more painful (and more error prone) than writing 5--10 lines of code.
That said, if it made you look at regexes deeply and beyond the simple
of what each character (*, ., +) does I think the teacher ended up
making you learn
FInally, the simplest NON-REGEX method is probably
return sorted(s) == list(s)
It is useful learning to add default parameters to this
to improve the functionality to case-dependent or
case independent modes.
More information about the Tutor