# File: popTest.py # # Running time test for Python's pop function for lists. # Using pop at the front of the list (index 0) is much # slower than pop at the end of the list (index -1). # import time import random REPS = 400000 # REPS = 10 aList = [ 0 ] * REPS start = time.time() for i in range (0, REPS): aList.pop(0) #aList.pop(-1) # print(len(aList)) finish = time.time() print("Elapsed time =", finish - start, "seconds")