from timeit import timeit foo = lambda: 'a' in '123456789'bar = lambda: ord('0') <= ord('a') <= ord('9') print [timeit(f) for f in (foo, bar)]
Standard input is empty
[0.2140510082244873, 0.4389171600341797]
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!