Calculate median of a matrix
Follow PEP8


A is a bad variable name, use say matrix.
You should remove the space in-front of the function argument.
You should put spaces after ,.
You don't need the () surrounding sorted.
You could add some space around your division.

You can use // rather than / to make your code Python 2 and Python 3 compatable.
You don't need to use pop, normal indexing will work too.




def find_median(matrix):
    """Returns the median value from given matrix"""
    for i in range(1, len(matrix)):
        matrix[0].extend(matrix[i])
    return sorted(matrix[0])[len(matrix[0]) // 2]




Your code doesn't work as the challenge asks, if you add print(matrix) before return you'll see:

[[1, 3, 5, 2, 6, 9, 3, 6, 9], [2, 6, 9], [3, 6, 9]]