Advertisement
Guest User

Untitled

a guest
Oct 18th, 2017
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.20 KB | None | 0 0
  1. $ python -m timeit "s = 'ABC' * 1000" "''.join(reversed(s))"
  2. 10000 loops, best of 3: 42.8 usec per loop
  3.  
  4. $ python -m timeit "s = 'ABC' * 1000" "s[::-1]"
  5. 100000 loops, best of 3: 2.64 usec per loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement