List returned from function is 0, Python3 : I'm writing a program in Python to better understand my linear algebra course.  
I'm trying to use a function to get the RREF form of an input matrix. The function works and prints what it should. When I return what it printed ( code below ) and access that returned value, it will not provide a list. Instead, it returns 0.  
How can I access the returned value as a list?

Here's the function:  
    `global rref_matrix
    rref_matrix = [[c for c in matrix_given[i]] for i in range(len(matrix_given))]
    print(rref_matrix)
    leading_one = 0
    rowCount = len(rref_matrix)
    columnCount = len(rref_matrix[0])
    for row in range(rowCount):
        if columnCount <= leading_one:
            break
        r = row
        while rref_matrix[r][leading_one] == 0:
            r += 1
            if rowCount == r:
                r = row
                leading_one += 1
                if columnCount == leading_one:
                    print(rref_matrix)
                    return 0
        rref_matrix[r], rref_matrix[row] = rref_matrix[row], rref_matrix[r]
        if rref_matrix[row][leading_one] != 0:
            rref_matrix[row][:] = [x / rref_matrix[row][leading_one] for x in rref_matrix[row]]
        for new_row in range(len(rref_matrix)):
            if new_row != row:
                rref_matrix[new_row][:] = [x - (rref_matrix[new_row][leading_one] * rref_matrix[row][rref_matrix[new_row].index(x)]) for x in rref_matrix[new_row]] 
        leading_one += 1
        print(rref_matrix)
    return rref_matrix`  

And I access it as follows:  
`    rref_transposed = [row for row in rref(list(zip(*matrix)))]
    print(rref_transposed)`    
It prints 0.   
  
What am I not seeing?  
Thanks in advance!