<prompt> Ho latela palo ea linomoro, ngola lenaneo ho fumana boleng ba bohareng.10, 20, 30, 40  <response>: Instruction in English: Given an array of numbers, write a program to find the median value. . Response in English: To find the median value of an array of numbers, you need to do the following:1. Sort the array in ascending order2. Check if the array length is an odd number or an even number3. If the length is an odd number, the median is the element in the middle of the sorted array4. If the length is an even number, calculate the median by finding the average of two middle elements in the sorted arrayHeres the code in Python that finds the median value of the given array:pythondef find_medianarr: Sort the array arr sortedarr n lenarr Check if the length is odd or even if n 2 0: Get the average of two middle elements return arrn2 - 1 arrn2 2 else: Get the middle element return arrn2Using the above function, we can find the median value of the given input array:pythoninput_arr 10, 20, 30, 40median find_medianinput_arrprintfThe median value of the given array is: medianOutput: The median value of the given array is: 25.0. . Response in Sesotho: Ho fumana boleng ba mahareng ba palo ea palo, o hloka ho etsa tse latelang: 1. Hlopha sehlopha ka tatellano e nyolohang , bohare ke elemente bohareng ba sehlopha se hlophilweng 4. Haeba bolelele e le palo e lekanang, bala mahareng ka ho fumana palohare ya dikarolo tse pedi tse mahareng tse hlophilweng Mona ke khoutu e Python e fumanang boleng ba bohare ba sehlopha se fanoeng: python def find_medianarr: Hlophisa lethathamo la arr hlophiloearr n lenarr Sheba hore na bolelele bo makatsa kapa le haeba n 2 0: Fumana karolelano ea likarolo tse peli tse bohareng li khutla arrn2 - 1 arrn2 2 tse ling: Fumana karolo e bohareng ea ho khutlisa arrn2 Re sebelisa tsebetso e kaholimo, re e ka fumana boleng ba mahareng ba lenane le fanoeng la ho kenya: python input_arr 10, 20, 30, 40 median find_medianinput_arr printfBoleng ba bohareng ba sehlopha se fanoeng ke: median. Sephetho: Boleng ba mahareng ba sehlopha se fanoeng ke: 25.0. 