Computer Science, asked by gauravsingh2366, 6 months ago

write a user defined function to search largest element of a list and return it​

Answers

Answered by parthu2011
1

Answer:

python3

# Python3 program to find maximum  

# in arr[] of size n  

# python function to find maximum  

# in arr[] of size n  

def largest(arr,n):  

# return max using max  

# inbuilt max() function  

return (max(arr))  

# Driver Code  

arr = [10, 324, 45, 90, 9808]  

n = len(arr)  

#calculating length of an array  

Ans = largest(arr,n)  

#display max  

print ("Largest in given array is",Ans)  

Output:

Largest in given array is 9808

Explanation:

if you are pleased with answer in turn

please subscribe my youtube chanel(Ramakrishna Nallangari youtube channel) for my effort

search for nallangari in google and find ramakrishna nallnagari and then click it and subscribe

Similar questions