Which is faster?
t-meyer at ihug.co.nz
Thu Jan 27 03:52:54 CET 2005
> Any idea which of the following is faster?
> Thanks in advance.
> P.S. I could time it but I thought of trying my luck here
> first, in case someone knows already, and of course the reason.
Timing it is almost no work, though:
>>> import timeit
The obvious reason for the former to be faster (although I haven't checked
to see whether it's true) is because the latter checks for a specific
character, whereas the former just snips it off whatever it is.
More information about the Python-list