Reputation: 87
I have to find maximum elements per column except the first column inside the nested list I tried using that but that didn't worked
v=[['a',1,10,3],['b',2,3,11],['c',3,4,5]]
answer =v[0]
for current in v[1:]:
answer = [max(x, y) for x, y in zip(answer[0][1:], current[1:])]
print(answer)
it should return [3,10,11]
Upvotes: 1
Views: 28