def median(data):\n    data.sort()\n    if len(data) % 2 == 0:\n        n = len(data) // 2\n        return (data[n-1] + data[n]) / 2\n    else:\n        return data[len(data) // 2]
Generate a program in Python to find the median of a list.?