Find the largest value in the list and the index of the last element that has the given value in one pass through the list, without modifying this list or using an additional list.
a= input (). split () print (max (a), a.index (max (a)))
There is a problem where two or more elements in a list are equal to the maximum of the list. How do I get the index of the latter?
- Loop in python in one line
- python : Chunks () function with yield, when calling list (chunks ())
- How to combine the same keys in a dictionary? Python
- python : How can I check if one of the elements of one list is in an element of another list?
- List items of lists split across two python lists
- python : Exception TypeError: unhashable type: 'list'
- python : How to create a list in a specific interval?
- python : How to enroll?
- python : How do I change an item in the list?
- python : How do I correctly count the overlapping items in two lists?