# File: timeTest2.py # # Checking out the running time of list indexing. # import time import random REPS = 1000000 #REPS = 10 SIZE = 2000000 random.seed() aList = [ 0 ] * SIZE start = time.time() for i in range (0, REPS): index = random.randint(0,SIZE-1) # print("index =", index) aList[index] = 21783 finish = time.time() print("Elapsed time =", finish - start, "seconds")