I'll try to explain some of the things that look odd within here, hopefully that might give some hints.

Hopefully I don't misinterpret anything!

```
if len(lst) % 3 == 0:
return lst[index_odd]
else:
if len(lst) % 2 == 0:
return ((lst[index_even_l]) + (lst[index_even_r]))/2.0
```

- " if len(lst) % 3 == 0 " odd numbers won't always be equal to 0 when % by 3. for example this code would skip this if statement if len(lst) was equal to 11.
- in this code block you have two "if"s and one within an "else" this could be shortened down to one if and one else.

For example:

```
if len(lst) % 2 == 0:
return ((lst[index_even_l]) + (lst[index_even_r]))/2.0
else:
return lst[index_odd]```
```

would solve both these problems. as "(even_number) % 2 == 0" will always be true which then activates the if statement when the len(lst) is even, and since "else:" doesn't have a condition, everything other than when len(lst) == even will pass through else, and as there is only odd and even, only odd will pass through.

if you need to have two conditions it's better to have elif (else if) rather than if within else.

I'll put my solution to the problem below and explain it, and hopefully it helps.

Raw:

```
def median(taken_list):
taken_list = sorted(taken_list)
mid_point = (len(taken_list) / 2)
if len(taken_list) % 2 == 0:
return ((taken_list[mid_point - 1]) + (taken_list[mid_point])) / (2.0)
else:
return taken_list[mid_point]
```

Explained:

```
def median(taken_list):
taken_list = sorted(taken_list) #sorts the list
mid_point = (len(taken_list) / 2) #finds the mid point of the list
if len(taken_list) % 2 == 0: #finds "if" there's an even length of list, and if so;
return ((taken_list[mid_point - 1]) + (taken_list[mid_point])) / (2.0) #returns the equation. (see reasoning below)
else:
return taken_list[mid_point] # if not even length of list (else) return the the value of the taken list at the index [mid_point]
Reason for the "even equation" ;
# 1. ( (1 down from midde) + (1 up from middle) ) / 2
# 2. list start at index 0, and length counts from 1, you don't need to +1 the second "(taken_list[mid_point])"
```