Just use max
with a generator expression:
>>> lst = [[1, 2, 3], [2, 4, 2], [0, 1, 1]]
>>> max(l[2] for l in lst)
3
Also, don’t name your variables list
, you are shadowing the type.
More Related Contents:
- How to create the following lists with list comprehensions? [closed]
- What does “list comprehension” and similar mean? How does it work and how can I use it?
- What are the advantages of NumPy over regular Python lists?
- Python List vs. Array – when to use?
- How to read a text file into a list or an array with Python
- Why is a list comprehension so much faster than appending to a list?
- Python’s most efficient way to choose longest string in list?
- List comprehension vs generator expression’s weird timeit results?
- Appending item to lists within a list comprehension
- Find nearest indices for one array against all values in another array – Python / NumPy
- How to frame two for loops in list comprehension python
- How to return a subset of a list that matches a condition [duplicate]
- Sort multidimensional array based on 2nd element of the subarray
- Initializing a list to a known number of elements in Python [duplicate]
- Implement list-like index access in Python
- Numpy individual element access slower than for lists
- list.extend and list comprehension [duplicate]
- Comprehension on a nested iterables?
- How do I declare an array in Python?
- remove None value from a list without removing the 0 value
- How can I use list comprehensions to process a nested list?
- How to access a column in a list of lists in python
- How to sort multidimensional array by column?
- sum each value in a list of tuples
- Duplicate elements in a list [duplicate]
- Python list([]) and []
- Python recursive function to display all subsets of given set
- Python: Elegant and efficient ways to mask a list
- Unexpected Behavior of Extend with a list in Python [duplicate]
- Skip elements on a condition based in a list comprehension in python