'''Miscellaneous stuff from class on Friday, Oct 9. ''' oneYear = [1954, 65, 8, 112] print oneYear[0], max(oneYear[1:]) def getHighTempAndYear(data): '''Expects data to be a list of lists of integers like in the weather data assignment description. Returns a two-item list--first the year of the highest temp, and then the highest temp itself.''' highTemp = data[0][1] yearOfHighTemp = data[0][0] for yearData in data: for temp in yearData[1:]: if temp > highTemp: highTemp = temp yearOfHighTemp = yearData[0] return [yearOfHighTemp, highTemp] data = [[1939, 5, 10, 30], [1961, 44, 117, 3], [2009, 6, 12, 5]] results = getHighTempAndYear(data) print 'Year:', results[0] print 'Temp:', results[1]