Write a program to find the maximum of a list of numbers
- def Max(*lst):lst=lst[0]temp=lst[0]for item in lst[1:]:if temp<item:temp=itemreturn tempelements=[]num_of_elmenets=int(input("how many elment you want to Enter: "))for i in range(num_of_elmenets):elm=int(input("Enter element "))elements.append(elm)print("The maximum element is ")print(Max(elements))
Output:-
0 Comments