Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- from timeit import timeit
- ts = lambda: sorted(list_to_sort)
- list_to_sort = [ ]
- for x in range(0,1000):
- list_to_sort.append(random.randint(0,1000))
- print("Data = ",list_to_sort)
- print("Timsort took: ")
- print(timeit(ts, number = 100))
Advertisement
Add Comment
Please, Sign In to add comment