My code works...Its ugly and probably not the best way to solve this problem...I feel like there is a better way to do this than the way that I did. I would appreciate any feedback as to what I could or should do differently in the future so that I come up with the best possible solutions.

Oh, for some reason the line div = (div + i) / 2 returns the incorrect answer when I did it on one line....

```
def median(nums):
numbers = sorted(nums)
mid_point = len(numbers) / 2
if len(numbers) % 2 != 0:
num = 0
numbers = numbers[mid_point:mid_point + 1]
for o in numbers:
num = num + o
return num
else:
div = 0.0
numbers = numbers[mid_point - 1:mid_point + 1]
for i in numbers:
div = div + i
divide = div / 2
return divide
```