Answers for "find maximum and second maximum ellemen in a list python"

1

second max from list python

# Python program to find largest
# number in a list
 
# list of numbers
list1 = [10, 20, 4, 45, 99]
 
# sorting the list
list1.sort()
 
# printing the second last element
print("Second largest element is:", list1[-2])
Posted by: Guest on June-18-2021
0

finding the maximum value in a list python

arr = [0, 1, 2, 3]
maximum_value = max(arr)
print(maximum_value) #should print 3
Posted by: Guest on August-09-2021

Code answers related to "find maximum and second maximum ellemen in a list python"

Python Answers by Framework

Browse Popular Code Answers by Language