Hey there! I'm stuck on 15.Median. Link: https://www.codecademy.com/courses/python-intermediate-en-rCQKw/2/5?curriculum_id=4f89dab3d788890003000096#
I keep getting the message "Oops, try again. median() resulted in an error: unsupported operand type(s) for %: 'list' and 'int'"
I can't quite seem to figure out what's wrong with my code, although I suspect it's something to do with the syntax on lines 6 and 8. I can't work out how to word what I want to get done.
Replace this line with your code. Here is my code: def median(lst): result = 0 even = len(lst) / 2 lst.sort() if lst % 2 == 0: result = ([even(i) - 1] + [even(i)]) / 2 elif lst % 2 != 0: result = (even(i - 0.5)) return result I'd be really grateful for any help! Thank you.