here2share

# timeit_find_surprise.py

Apr 18th, 2021 (edited)
601
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. # timeit_find_surprise.py
  2.  
  3. from timeit import timeit
  4.  
  5. t = timeit(stmt='"5" in string',
  6.            setup='string = "abcefg0123456789"',
  7.            number=10 ** 7)
  8. print t
  9.  
  10. t = timeit(stmt='"5" in string',
  11.            setup='string = list("abcefg0123456789")',
  12.            number=10 ** 7)
  13. print t
  14.  
  15. t = timeit(stmt='"5" in string',
  16.            setup='string = set("abcefg0123456789")',
  17.            number=10 ** 7)
  18. print t
Add Comment
Please, Sign In to add comment