<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def median(data):
 """ Return the median of numeric data, unsing the "mean of middle two" method. If ``data`` is empty, ``0`` is returned. Examples -------- 3.0 When the number of data points is even, the median is interpolated: 4.0 """


    if len(data) == 0:
        return None

    data = sorted(data)
    return float((data[len(data) // 2] + data[(len(data) - 1) // 2]) / 2.)