How to "unzip" then slice and find max for elements in a list of lists in
Python
I have a list of lists and need to find a way to find the max of the
numerical portion of element [0] of each list. I know it'll involve
slicing and finding max and think it'll involve the zip(*L) function but
don't really know how to get there. For example, what I have is a list of
lists that looks like this:
L = [['ALU-001', 'Aluminum', 50], ['LVM-002', 'Livermorium', 20],
['ZIN-003', 'Zinc', 30]]
and need to find the largest numerical portion (ex. 001) of the first
elements.
No comments:
Post a Comment