def ones_in_corners(n):
    '''
    Creates an nxn matrix full of 0s, except the corners of the matrix
    will have 1s in it.
    eg. ones_in_corners(3) would give us
    1 0 1
    0 0 0
    1 0 1
    :param n: the size of the square matrix
    :return:
    '''
    # setup a single row of n ' ' (space) chars
    row = ['0'] * n
    # now we will make the mat have n rows
    mat = [row] * n
    # the following four lines make it so only
    # the corners of the matrix has 1s
    mat[0][0] = '1'
    mat[0][n-1] ='1'
    mat[n-1][0] = '1'
    mat[n-1][n-1] = '1'
    return mat
print(ones_in_corners(3)) ''' output is [['1', '0', '1'], ['1', '0', '1'], ['1', '0', '1']] but I want it to be [['1', '0', '1'], ['0', '0', '0'], ['1', '0', '1']] '''
