I’m learning Python and working with a list of lists where each inner list contains numeric values.
Example:
scores = [
[80, 90, 85],
[75, 88, 92],
[90, 85, 80]
]
Each inner list represents values for one item, and I want to:
Compute the average of each inner list
Find which inner list has the highest average
Return its index (0-based)
If two or more averages are the same, I want to return the smallest index.
I know how to calculate an average, but I’m not sure what the cleanest way is to compare all of them while keeping track of the index. Any beginner-friendly approach would be appreciated.