import time # read input from file with open('statisticiansA-M.txt') as file: read_strings = file.read().splitlines() n = len(read_strings) # How many strings were written # truncate strings to k characters # append strings one-by-one # iterate above operation t times - timing tstart = time.time() #your code here tend = time.time() print(tend-tstart) # try to iterate more efficiently using arrays tstart2 = time.time() tend2 = time.time() print(tend2-tstart2) # are the two strings equal? print('longer_string == longer_string_v2? {0}'.format( longer_string == longer_string_v2))