<prompt> Create a program that takes an array and outputs the largest element1, 3, 15, 20, 8, 9  <response>: Here is one way you could write this program in Python:pythondef largest_elementarray: max array0 for num in array: if num max: max num return maxarray 1, 3, 15, 20, 8, 9result largest_elementarrayprintresultIn this code, we define a function, largest_element, which takes an array as an input, and returns the largest element of that array. Within the function, we initialize a variable max to the first element of the array. Then we iterate through the array using a for loop and compare the current element with the max element. If the current element is greater than max, then we update max with that value. At the end of the loop, we return the final value of max, which is the largest element in the array.We then call the function with the provided array as input, store the result in a variable, and print it. For the provided input of 1, 3, 15, 20, 8, 9, the program would output: 20 