''' Purpose: solve manx.py test problem ''' # get access to web files import url # testing repository REPOSITORY = 'http://www.cs.virginia.edu/~cs1112/datasets/testing/' # get filename filename = input( 'Enter file name: ' ) # specify link link = REPOSITORY + filename # get dataset dataset = url.get_dataset( link ) # print dataset print( dataset ) # determine maximum value in dataset # max of dataset itself will not work because it finds the "max" list since an element in dataset is a row # we want to find the max value of all cells in all the lists # 1 strategy: # get the max value of each row and make a new list of maxes # the max thing in the first row, the second row, ... maxes = [] for row in dataset: # get the max of the current row row_max = max( row ) # then append this max to our list accumulator maxes maxes.append( row_max ) # when we've found all the maxes in all the rows # we get the max value of all the maxes overall_max = max( maxes ) print( overall_max )