Python: Find all index positions of the maximum and minimum values in a given list using lambda
46. Index Max/Min Finder Lambda
Write a Python program to find the index position and value of the maximum and minimum values in a given list of numbers using lambda.
Sample Solution:
Python Code :
Sample Output:
Original list: [12, 33, 23, 10.11, 67, 89, 45, 66.7, 23, 12, 11, 10.25, 54] Index position and value of the maximum value of the said list: (5, 89) Index position and value of the minimum value of the said list: (3, 10.11)
For more Practice: Solve these Related Problems:
- Write a Python program to find the indices of all occurrences of the maximum value in a list using lambda.
- Write a Python program to determine the index positions of the top two maximum values in a list using lambda.
- Write a Python program to return the index and value of the first occurrence of the minimum value in a list using lambda.
- Write a Python program to find the indices of both the maximum and minimum values in a list and swap them using lambda.
Go to:
Previous: Write a Python program to convert string element to integer inside a given tuple using lambda.
Next: Write a Python program to sort a given mixed list of integers and strings using lambda. Numbers must be sorted before strings.Python Code Editor:
Have another way to solve this solution? Contribute your code (and comments) through Disqus.
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.