Write а functiоn definitiоn thаt tаkes in оne list L.The function returns a value as shown below. if the list has an even number of elements, return the average of 2 middle elements.Otherwise return the average of the first and last elements. For example, if the list is [1,2,3,4] return the average of 2 and 3, otherwise if the list is [1,2, 3, 4, 5] return the average of 1 and 5. Do not add any comments. Then complete the code for a main function that starts as shown: def main(): ML = [.......] #where ....... are a bunch of numbers separated by commas. Display the result of calling the function above on that list then call main.