fork download
  1. import timeit
  2.  
  3. print(timeit.timeit('list(map(lambda x: x*x, range(10)))'))
  4. print(timeit.timeit('[x*x for x in range(10)]'))
Success #stdin #stdout 2.36s 27824KB
stdin
Standard input is empty
stdout
1.5655903220176697
0.7803761437535286