For correctness you'd need to consider all possible lengths of that list, if you convince yourself that it's correct for lengths 1, 2, 3 and that adding any length to that will just add iterations then you've done a fairly good assessment of its correctness.
I would point out that it's slow for large lists. The best known amount of time required to find the median is linear, that is, for each extra length, the amount of time grows by the same amount. There's an algorithm called quick-select that can find the nth smallest value in linear time, that can be used to select the middle or middle two values. Yours is instead quadratic, because for each added length, you iterate through the whole list (actually half on average, but that's a negligible difference. Removing also takes linear time each time you do it). For example, for a list of size 1000, an optimal algorithm would take on the order of 1000 operations, while yours would take on the order of 1000000 operations.
If you're only concerned with correctness then that's fine, sometimes that's ok, like when you know that only small data input will be used.
Doing it in linear time is far beyond the level of this course. There may be libraries that can find the nth smallest value (numpy), that could be used. Something in-between though is sorting, comparison sort takes N log N time (for length 1000 that would would be on the order of 10000 operations)
As for the code itself (disregarding what it's doing), the code for the loops is duplicated, the same loop can be used for both cases, and then look at what's remaining once there is one or two values left.