# no imports allowed! We want you to solve this problem with loops!

def get_row(array, n):
    """
    Inputs:
        array (2d list) - list of lists of numbers (floats or ints)
        n (int) - desired row index in the array

    Returns:
        A list representing all the numbers in the nth row of a 2d array.
    """
    pass # your code here

def get_col(array, n):
    """
    Inputs:
        array (2d list) - list of lists of numbers (floats or ints)
        n (int) - desired column index in the array

    Returns:
        A list representing all the numbers in the nth column of a 2d array.
    """
    pass # your code here

def get_total(array, n, use_row):
    """
    Inputs:
        array (2d list) - list of lists of numbers (floats or ints)
        n (int) - desired row / column index
        use_row (bool) - indicates whether to get total for row n (True)
                        or column n (False)

    Returns:
        A number representing the total of all numbers in the
        nth row / column of a 2-d array.

        Does not include negative numbers in the total
        (we assume negative numbers are data entry errors).
    """
    pass # your code here


def get_mean(array, n, use_row):
    """
    Inputs:
        array (2d list) - list of lists of numbers (floats or ints)
        n (int) - desired row / column index
        use_row (bool) - indicates whether to get mean for row n (True)
                        or column n (False)

    Returns:
        A number representing the average of all numbers in the nth row /
        column of a 2-d array. Ignores negative numbers (we assume negative
        numbers are data entry errors).

        If the mean cannot be calculated due to lack of data, return None.
    """
    pass # your code here

def get_full_total(array):
    """
    Inputs:
        array (2d list) - list of lists of numbers (floats or ints)

    Returns:
        The total of all numbers in the 2-d array (ignoring negative numbers).
    """
    pass # your code here


if __name__ == "__main__":
    num_array = [[1,2,3],
                 [4,5,6]]
    farm_data = [[-5, -100,  -20],
                 [-1,  100.5, 25],
                 [-2,    0,   50.9],
                 [-3,  150,   0]]

    # Local testing -- feel free to add your own tests as well!
    print(f"Got {get_row(num_array, 1)=}, Expected=[4, 5, 6]")
    print(f"Got {get_row(farm_data, 0)=}, Expected=[-5, -100, -20]")
    print(f"Got {get_col(num_array, 0)=}, Expected=[1, 4]")
    print(f"Got {get_col(farm_data, 2)=}, Expected=[-20, 25, 50.9, 0]")
    print(f"Got {get_total(num_array, 1, True)=}, Expected=15")
    print(f"Got {get_total(farm_data, 0, True)=}, Expected=0")
    print(f"Got {get_total(num_array, 0, False)=}, Expected=5.0")
    print(f"Got {get_total(farm_data, 2, False)=}, Expected=75.9")
    print(f"Got {get_mean(num_array, 1, True)=}, Expected=5")
    print(f"Got {get_mean(farm_data, 0, True)=}, Expected=None")
    print(f"Got {get_mean(num_array, 0, False)=}, Expected=2.5")
    print(f"Got {get_mean(farm_data, 2, False)=}, Expected=25.3")
    print(f"Got {get_full_total(num_array)=}, Expected=21")
    print(f"Got {get_full_total(farm_data)=}, Expected=326.4")