def integrate(lst): """Return a list of numbers such that each is the sum of the numbers in lst through the corresponding position. More precisely, the i_th value in the returned list is the sum of the values in lst from its beginning up to and including the i_th value in lst. (This is the discrete counterpart of integration in calculus.) >>> assert integrate([3, 5, 1]) == [3, 3+5, 3+5+1] >>> integrate([2, 1]) [2, 3] >>> """ #. #. #. #. #. #. def min_of_column(matrix, column_index): """Return the minimum of the numbers in the column of the matrix indicated by the given index, where a matrix is a non-empty list of rows, which are lists of numbers. >>> min_of_column([[2,5,1], [3,7,1], [8,2,0]], 1) 2 >>> """ #. #. #. #. #. #. def is_decimal_number(s): """Return a boolean value indicating if string s is of the form [-]dd*[.]d* or [-].dd*, where square brackets indicate optional values, d* indicates zero or more digits (characters 0 through 9, and d indicates one digit. (Strings in these forms parse as floating point numbers.) >>> is_decimal_number('.3') True >>> is_decimal_number('-.') False >>> is_decimal_number('') False >>> is_decimal_number('5') True >>> is_decimal_number('-5.3439148') True >>> is_decimal_number('0.3.4') False >>> """ # Hint: recall the string method find(string), and the string method # isdigit(string), which indicates if the string contains only digits. #. #. #. #. #. #. #. #. def find_all(lst, value): """Return a list of the indices (in numberic order) of all occurrences of value in lst. >>> find_all([1, 5, 3, 1, 2, 1], 1) [0, 3, 5] >>> """ # Hint: recall the list method append(value). #. #. #. #. #. def make_table(lst, num_cols): """Make a table with the indicated number of columns containing the elements of lst in row-order. >>> make_table(list('abcde'), 3) [['a', 'b', 'c'], ['d', 'e']] >>> """ answer = [] for index in range(len(lst)): if index % num_cols == 0: row = [] answer.append(row) row.append(lst[index]) return answer def add_command(): """Usage: python addcommand.py N1 N2 prints the sum of the numbers N1 and N2 > python addcommand.py 3.1 4 7.1 > """ # Hint: use sys.argv #. #. #.