I'm not going to lie. If I do not know the solution I check on google what to do and going through different solutions to try understand it.
Here is the one I cannot figure it out.
How is lst[n//2] finding a median with a odd list of numbers.
What does lst[n//2] exactly do?. Please advise
numbers = [4, 9, 10, 13, 15, 16, 17] def median(lst): lst = sorted(lst) n = len(lst) if n < 1: return None if n % 2 == 1: return lst[n//2] print median(numbers)