python
hey guys i'm currently taking a python course in codecademy and i encountered a difficult question. Create a function called middle_element that has one parameter named lst. If there are an odd number of elements in lst, the function should return the middle element. If there are an even number of elements, the function should return the average of the middle two elements. i decided to use the modulus operator this is how far in writing the code i got: def middle_element(lst): number_of_elements = len(lst) if number_of_elements % 2 == 0 return whats disturbing me is how to write the function that will take the middle number from number_of _elements. since there is no way for me to know how many elements it will have hence making selecting from the list a bit tricky. please assist.